1 | <?php |
||
23 | class ModelCollection extends ActiveRecord\ModelCollection |
||
24 | { |
||
25 | /** |
||
26 | * @var ModuleCollection |
||
27 | */ |
||
28 | private $modules; |
||
29 | |||
30 | /** |
||
31 | * @param ConnectionCollection $connections Connections manager. |
||
32 | * @param ModuleCollection $modules ModuleCollection manager. |
||
33 | * @param array $definitions Model definitions. |
||
34 | */ |
||
35 | public function __construct(ConnectionCollection $connections, ModuleCollection $modules, array $definitions = []) |
||
41 | |||
42 | /** |
||
43 | * Checks if a model exists by first checking if the module it belongs to is enabled and that |
||
44 | * it actually defines the model. |
||
45 | * |
||
46 | * @param string $id |
||
47 | * |
||
48 | * @return bool |
||
49 | */ |
||
50 | public function offsetExists($id) |
||
63 | |||
64 | /** |
||
65 | * Gets the specified model of the specified module. |
||
66 | * |
||
67 | * The pattern used to request a model is `<module_id>[/<model_id>]` where `<module_id>` is |
||
68 | * the identifier of the module and `<model_id>` is the identifier of the module's model. The |
||
69 | * `<model_id>` part is optional and defaults to `primary`. |
||
70 | * |
||
71 | * @param string $id Identifier of the model. |
||
72 | * |
||
73 | * @return ActiveRecord\Model |
||
74 | */ |
||
75 | public function offsetGet($id) |
||
91 | } |
||
92 |