1 | <?php |
||
19 | class ApiController extends AppController |
||
20 | { |
||
21 | |||
22 | /** |
||
23 | * @var ServiceRegistry |
||
24 | */ |
||
25 | public $Services; |
||
26 | |||
27 | /** |
||
28 | * Initialize controller. |
||
29 | * |
||
30 | * @return void |
||
31 | */ |
||
32 | public function initialize() |
||
33 | { |
||
34 | parent::initialize(); |
||
35 | if ($this->components()->has('Auth')) { |
||
36 | $this->Auth->allow(['process', 'describe', 'listing']); |
||
37 | } |
||
38 | if ($this->components()->has('RememberMe')) { |
||
39 | $this->components()->unload('RememberMe'); |
||
40 | } |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * Process api request |
||
45 | * |
||
46 | * @return \Cake\Http\Client\Response|\Cake\Http\Response|null |
||
47 | */ |
||
48 | public function process() |
||
49 | { |
||
50 | return $this->_process(); |
||
51 | } |
||
52 | |||
53 | /** |
||
54 | * Process listing api request. |
||
55 | * |
||
56 | * @return void |
||
57 | */ |
||
58 | public function listing() |
||
66 | |||
67 | /** |
||
68 | * Process describe api request. |
||
69 | * |
||
70 | * @return void |
||
71 | */ |
||
72 | public function describe() |
||
80 | |||
81 | /** |
||
82 | * Process api request |
||
83 | * |
||
84 | * @param array $options Options |
||
85 | * @return \Cake\Http\Client\Response|\Cake\Http\Response|null |
||
86 | */ |
||
87 | protected function _process($options = []) |
||
121 | } |
||
122 |