@@ 174-180 (lines=7) @@ | ||
171 | * |
|
172 | * @return ActiveRecord |
|
173 | */ |
|
174 | public static function firstBy($field, $value, $params = []) |
|
175 | { |
|
176 | $field = self::sqlItemSanitize($field); |
|
177 | $params['where'] = "$field = ?"; |
|
178 | ||
179 | return self::first($params, $value); |
|
180 | } |
|
181 | ||
182 | /** |
|
183 | * Obtener la primera coincidencia de las condiciones indicadas. |
|
@@ 292-298 (lines=7) @@ | ||
289 | * |
|
290 | * @return \PDOStatement |
|
291 | */ |
|
292 | public static function allBy($field, $value, $params = []) |
|
293 | { |
|
294 | $field = self::sqlItemSanitize($field); |
|
295 | $params['where'] = "$field = ?"; |
|
296 | ||
297 | return self::all($params, $value); |
|
298 | } |
|
299 | ||
300 | /** |
|
301 | * Cuenta los registros que coincidan con las condiciones indicadas. |