1 | <?php |
||
22 | class Hooks |
||
23 | { |
||
24 | /** |
||
25 | * Synthesizes the `activerecord_facets` config from `activerecord` fragments. |
||
26 | * |
||
27 | * @param array $fragments |
||
28 | * |
||
29 | * @return array |
||
30 | */ |
||
31 | static public function synthesize_config(array $fragments) |
||
57 | |||
58 | /** |
||
59 | * Returns the criteria associated with the specified model. |
||
60 | * |
||
61 | * The criteria include the criteria of the parent models. |
||
62 | * |
||
63 | * @param Model|PrototypedBindings $model |
||
64 | * |
||
65 | * @return array |
||
66 | */ |
||
67 | static public function criteria_from(Model $model) |
||
93 | |||
94 | /** |
||
95 | * Returns the {@link CriterionList} instance associated with the specified model. |
||
96 | * |
||
97 | * @param Model|ModelBindings $model |
||
98 | * |
||
99 | * @return CriterionList |
||
100 | */ |
||
101 | static public function criterion_list_from(Model $model) |
||
117 | |||
118 | /** |
||
119 | * Fetches the records matching the specified conditions. |
||
120 | * |
||
121 | * A {@link BasicFetcher} instance is used to fetch the records. |
||
122 | * |
||
123 | * @param Model $model |
||
124 | * @param array $conditions |
||
125 | * |
||
126 | * @return RecordCollection|null |
||
127 | */ |
||
128 | static public function fetch_records(Model $model, array $conditions) |
||
142 | |||
143 | /** |
||
144 | * Fetches a record matching the specified conditions. |
||
145 | * |
||
146 | * The model's {@link fetch_records} prototype method is used to retrieve the record. |
||
147 | * |
||
148 | * @param Model|ModelBindings $model |
||
149 | * @param array $conditions |
||
150 | * @param Fetcher $fetcher If the parameter `fetcher` is present, the {@link Fetcher} |
||
151 | * instance used to fetch the record is stored inside. |
||
152 | * |
||
153 | * @return ActiveRecord|null |
||
154 | */ |
||
155 | static public function fetch_record(Model $model, array $conditions, &$fetcher = null) |
||
168 | } |
||
169 |