1 | <?php namespace Anomaly\Streams\Platform\Support; |
||
14 | class Locator |
||
15 | { |
||
16 | |||
17 | /** |
||
18 | * The addon collection. |
||
19 | * |
||
20 | * @var AddonCollection |
||
21 | */ |
||
22 | protected $addons; |
||
23 | |||
24 | /** |
||
25 | * The config repository. |
||
26 | * |
||
27 | * @var Repository |
||
28 | */ |
||
29 | protected $config; |
||
30 | |||
31 | /** |
||
32 | * Create a new Locator instance. |
||
33 | * |
||
34 | * @param AddonCollection $addons |
||
35 | * @param Repository $config |
||
36 | */ |
||
37 | public function __construct(AddonCollection $addons, Repository $config) |
||
42 | |||
43 | /** |
||
44 | * Locate the addon containing an object. |
||
45 | * Returns the addon's dot namespace. |
||
46 | * |
||
47 | * @param $object |
||
48 | * @return null|string |
||
49 | */ |
||
50 | public function locate($object) |
||
74 | |||
75 | /** |
||
76 | * Return the located addon instance. |
||
77 | * |
||
78 | * @param $object |
||
79 | * @return \Anomaly\Streams\Platform\Addon\Addon|mixed|null |
||
80 | */ |
||
81 | public function resolve($object) |
||
89 | } |
||
90 |