1 | <?php |
||
14 | final class TestApi implements CrudsApiInterface, StaticApiFactoryInterface, EntityCacheAwareInterface |
||
15 | { |
||
16 | /** @var RpcClientInterface */ |
||
17 | private $client; |
||
18 | /** @var ApiMetadata */ |
||
19 | private $metadata; |
||
20 | /** @var EntityDataCacheInterface */ |
||
21 | private $cache; |
||
22 | |||
23 | /** |
||
24 | * TestApi constructor. |
||
25 | * |
||
26 | * @param RpcClientInterface $client |
||
27 | * @param ApiMetadata $metadata |
||
28 | */ |
||
29 | public function __construct(RpcClientInterface $client, ApiMetadata $metadata) |
||
35 | |||
36 | public static function createApi(RpcClientInterface $client, ApiMetadata $metadata) |
||
40 | |||
41 | /** {@inheritdoc} */ |
||
42 | public function count(array $criteria) |
||
48 | |||
49 | /** {@inheritdoc} */ |
||
50 | public function create(array $data) |
||
56 | |||
57 | /** {@inheritdoc} */ |
||
58 | public function find(array $identifier) |
||
72 | |||
73 | /** {@inheritdoc} */ |
||
74 | public function patch(array $identifier, array $data, array $fields) |
||
80 | |||
81 | /** {@inheritdoc} */ |
||
82 | public function search(array $criteria = [], array $orderBy = null, $limit = null, $offset = null) |
||
96 | |||
97 | /** {@inheritdoc} */ |
||
98 | public function remove(array $identifier) |
||
104 | |||
105 | /** @return RpcClientInterface */ |
||
106 | public function getClient() |
||
110 | |||
111 | /** @return ApiMetadata */ |
||
112 | public function getMetadata() |
||
116 | |||
117 | /** {@inheritdoc} */ |
||
118 | public function setEntityCache(EntityDataCacheInterface $cache) |
||
122 | |||
123 | /** |
||
124 | * @param string $method |
||
125 | * |
||
126 | * @return string |
||
127 | */ |
||
128 | private function getMethod($method) |
||
132 | } |
||
133 |