1 | <?php |
||
21 | class Credential implements CrudInterface |
||
22 | { |
||
23 | /** |
||
24 | * Database class instance |
||
25 | * @var \gplcart\core\Database $db |
||
26 | */ |
||
27 | protected $db; |
||
28 | |||
29 | /** |
||
30 | * Hook class instance |
||
31 | * @var \gplcart\core\Hook $hook |
||
32 | */ |
||
33 | protected $hook; |
||
34 | |||
35 | /** |
||
36 | * Translation model instance |
||
37 | * @var \gplcart\core\models\Translation $translation |
||
38 | */ |
||
39 | protected $translation; |
||
40 | |||
41 | /** |
||
42 | * @param Hook $hook |
||
43 | * @param Config $config |
||
44 | * @param TranslationModel $translation |
||
45 | */ |
||
46 | public function __construct(Hook $hook, Config $config, TranslationModel $translation) |
||
52 | |||
53 | /** |
||
54 | * Loads a credential |
||
55 | * @param int $id |
||
56 | * @return array |
||
57 | */ |
||
58 | public function get($id) |
||
63 | |||
64 | /** |
||
65 | * Returns an array of credentials or counts them |
||
66 | * @param array $options |
||
67 | * @return array|integer |
||
68 | */ |
||
69 | public function getList(array $options = array()) |
||
111 | |||
112 | /** |
||
113 | * Adds a credential |
||
114 | * @param array $data |
||
115 | * @return int |
||
116 | */ |
||
117 | public function add(array $data) |
||
122 | |||
123 | /** |
||
124 | * Deletes a credential |
||
125 | * @param integer $id |
||
126 | * @return bool |
||
127 | */ |
||
128 | public function delete($id) |
||
132 | |||
133 | /** |
||
134 | * Delete "Service" credential |
||
135 | * @param int |
||
136 | * @return bool |
||
137 | */ |
||
138 | public function deleteService($id) |
||
158 | |||
159 | /** |
||
160 | * Updates a credential |
||
161 | * @param integer $id |
||
162 | * @param array $data |
||
163 | * @return boolean |
||
164 | */ |
||
165 | public function update($id, array $data) |
||
170 | |||
171 | /** |
||
172 | * Returns an array of credential handlers |
||
173 | * @return array |
||
174 | */ |
||
175 | public function getHandlers() |
||
204 | |||
205 | /** |
||
206 | * Call a credential handler |
||
207 | * @param string $handler_id |
||
208 | * @param string $name |
||
209 | * @param array $arguments |
||
210 | * @return mixed |
||
211 | */ |
||
212 | public function callHandler($handler_id, $name, array $arguments = array()) |
||
216 | } |
||
217 |