@@ 203-209 (lines=7) @@ | ||
200 | * |
|
201 | * @return ActiveRecord |
|
202 | */ |
|
203 | public static function firstBy($field, $value, $params = []) |
|
204 | { |
|
205 | $field = self::sqlItemSanitize($field); |
|
206 | $params['where'] = "$field = ?"; |
|
207 | ||
208 | return self::first($params, $value); |
|
209 | } |
|
210 | ||
211 | /** |
|
212 | * Obtener la primera coincidencia de las condiciones indicadas. |
|
@@ 318-324 (lines=7) @@ | ||
315 | * |
|
316 | * @return \PDOStatement |
|
317 | */ |
|
318 | public static function allBy($field, $value, $params = []) |
|
319 | { |
|
320 | $field = self::sqlItemSanitize($field); |
|
321 | $params['where'] = "$field = ?"; |
|
322 | ||
323 | return self::all($params, $value); |
|
324 | } |
|
325 | ||
326 | /** |
|
327 | * Cuenta los registros que coincidan con las condiciones indicadas. |