PageRenderTime 24ms CodeModel.GetById 16ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

/plugin/PBAPI/PBAPI/Methods.php

https://bitbucket.org/chamilo/chamilo-ext-repo-photobucket-dev/
PHP | 70 lines | 21 code | 7 blank | 42 comment | 0 complexity | c32a41feaf8330860ea3b8a18ce2014c MD5 | raw file
 1<?php
 2/**
 3 * Photobucket API 
 4 * Fluent interface for PHP5
 5 * Methods parent class
 6 * 
 7 * @author jhart
 8 * @package PBAPI
 9 * 
10 * @copyright Copyright (c) 2008, Photobucket, Inc.
11 * @license http://www.opensource.org/licenses/mit-license.php The MIT License
12 */
13
14/**
15 * Methods parent class
16 *
17 * @package PBAPI
18 */
19abstract class PBAPI_Methods
20{
21    
22    /**
23     * 'core' PBAPI object
24     *
25     * @var PBAPI
26     */
27    protected $core;
28
29    /**
30     * Class constructor
31     *
32     * @param PBAPI $core set the main class
33     */
34    public function __construct($core)
35    {
36        $this->core = $core;
37    }
38
39    /**
40     * Reset the methods objects
41     *
42     */
43    public function _reset()
44    {
45        $this->_load('base');
46    }
47
48    /**
49     * Default forwarder that says method not found
50     *
51     * @param string $name
52     * @param array $params
53     */
54    public function __call($name, $params)
55    {
56        throw new PBAPI_Exception("Method $name not found", $this->core);
57    }
58
59    /**
60     * Load a method class
61     *
62     * @param string $name Method class name (one of PBAPI/Methods/*)
63     * @return PBAPI_Methods
64     */
65    public function _load($name)
66    {
67        return $this->core->_loadMethodClass($name);
68    }
69
70}