@@ 189-195 (lines=7) @@ | ||
186 | * |
|
187 | * @return ActiveRecord |
|
188 | */ |
|
189 | public static function firstBy($field, $value, $params = []) |
|
190 | { |
|
191 | $field = self::sqlItemSanitize($field); |
|
192 | $params['where'] = "$field = ?"; |
|
193 | ||
194 | return self::first($params, $value); |
|
195 | } |
|
196 | ||
197 | /** |
|
198 | * Obtener la primera coincidencia de las condiciones indicadas. |
|
@@ 307-313 (lines=7) @@ | ||
304 | * |
|
305 | * @return \PDOStatement |
|
306 | */ |
|
307 | public static function allBy($field, $value, $params = []) |
|
308 | { |
|
309 | $field = self::sqlItemSanitize($field); |
|
310 | $params['where'] = "$field = ?"; |
|
311 | ||
312 | return self::all($params, $value); |
|
313 | } |
|
314 | ||
315 | /** |
|
316 | * Cuenta los registros que coincidan con las condiciones indicadas. |