1 | <?php |
||
9 | class AdapterFactory |
||
10 | { |
||
11 | const COLLECTION_ADAPTER = 'collection'; |
||
12 | const PAGINATION_ADAPTER = 'pagination'; |
||
13 | const ORDER_ADAPTER = 'order'; |
||
14 | const FILTER_ADAPTER = 'filter'; |
||
15 | const LIMIT_ADAPTER = 'limit'; |
||
16 | |||
17 | /** |
||
18 | * @var ContainerInterface |
||
19 | */ |
||
20 | private $container; |
||
21 | |||
22 | private $adapters = []; |
||
23 | |||
24 | /** |
||
25 | * AdapterFactory constructor. |
||
26 | * |
||
27 | * @param ContainerInterface $container |
||
28 | */ |
||
29 | public function __construct(ContainerInterface $container) { |
||
52 | |||
53 | /** |
||
54 | * @param string $adapterName |
||
55 | * @param callable $filter |
||
56 | */ |
||
57 | public function addAdapter(string $adapterName, callable $filter) { |
||
60 | |||
61 | /** |
||
62 | * @param $type |
||
63 | * |
||
64 | * @return mixed |
||
65 | * |
||
66 | * @throws UnknownAdapterException |
||
67 | */ |
||
68 | public function getByType($type) : Adapter { |
||
75 | |||
76 | } |
||
77 |