1 | <?php |
||
23 | class Hooks |
||
24 | { |
||
25 | /** |
||
26 | * Synthesizes a config from a namespace. |
||
27 | * |
||
28 | * The config fragments found in the namespace are merged with `array_merge()`. |
||
29 | * |
||
30 | * @param array $fragments |
||
31 | * @param string $namespace |
||
32 | * |
||
33 | * @return array |
||
34 | */ |
||
35 | static private function synthesize_config_from_namespace(array $fragments, $namespace) |
||
51 | |||
52 | /** |
||
53 | * Synthesizes the `activerecord_connections` config from `activerecord#connections` fragments. |
||
54 | * |
||
55 | * @param array $fragments |
||
56 | * |
||
57 | * @return array |
||
58 | */ |
||
59 | static public function synthesize_connections_config(array $fragments) |
||
63 | |||
64 | /** |
||
65 | * Synthesizes the `activerecord_models` config from `activerecord#models` fragments. |
||
66 | * |
||
67 | * @param array $fragments |
||
68 | * |
||
69 | * @return array |
||
70 | */ |
||
71 | static public function synthesize_models_config(array $fragments) |
||
75 | |||
76 | /* |
||
77 | * Events |
||
78 | */ |
||
79 | |||
80 | /** |
||
81 | * Patches the `get_model()` helper to use the model collection bound to the application. |
||
82 | * |
||
83 | * @param Core\BootEvent $event |
||
84 | * @param Core|CoreBindings $app |
||
85 | */ |
||
86 | static public function on_core_boot(Core\BootEvent $event, Core $app) |
||
94 | |||
95 | /* |
||
96 | * Prototypes |
||
97 | */ |
||
98 | |||
99 | /** |
||
100 | * Returns a @{link ConnectionCollection} instance configured with |
||
101 | * the `activerecord_connections` config. |
||
102 | * |
||
103 | * @param Core $app |
||
104 | * |
||
105 | * @return ConnectionCollection |
||
106 | */ |
||
107 | static public function core_lazy_get_connections(Core $app) |
||
118 | |||
119 | /** |
||
120 | * Returns a @{link ModelCollection} instance configured with |
||
121 | * the `activerecord_models` config. |
||
122 | * |
||
123 | * @param Core|CoreBindings $app |
||
124 | * |
||
125 | * @return ModelCollection |
||
126 | */ |
||
127 | static public function core_lazy_get_models(Core $app) |
||
138 | |||
139 | /** |
||
140 | * Getter for the "primary" database connection. |
||
141 | * |
||
142 | * @param Core|CoreBindings $app |
||
143 | * |
||
144 | * @return Connection |
||
145 | */ |
||
146 | static public function core_lazy_get_db(Core $app) |
||
150 | |||
151 | /** |
||
152 | * @param ActiveRecord $record |
||
153 | * |
||
154 | * @return ValidationErrors|array |
||
155 | */ |
||
156 | static public function active_record_validate(ActiveRecord $record) |
||
167 | |||
168 | /** |
||
169 | * Returns the records cache associated with the model. |
||
170 | * |
||
171 | * @param Model $model |
||
172 | * |
||
173 | * @return RuntimeActiveRecordCache |
||
174 | */ |
||
175 | static public function model_lazy_get_activerecord_cache(Model $model) |
||
179 | } |
||
180 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.