| @@ 162-168 (lines=7) @@ | ||
| 159 | * |
|
| 160 | * @return ActiveRecord |
|
| 161 | */ |
|
| 162 | public static function firstBy($field, $value, $params = []) |
|
| 163 | { |
|
| 164 | $field = self::sqlItemSanitize($field); |
|
| 165 | $params['where'] = "$field = ?"; |
|
| 166 | ||
| 167 | return self::first($params, $value); |
|
| 168 | } |
|
| 169 | ||
| 170 | /** |
|
| 171 | * Obtener la primera coincidencia de las condiciones indicadas. |
|
| @@ 280-286 (lines=7) @@ | ||
| 277 | * |
|
| 278 | * @return \PDOStatement |
|
| 279 | */ |
|
| 280 | public static function allBy($field, $value, $params = []) |
|
| 281 | { |
|
| 282 | $field = self::sqlItemSanitize($field); |
|
| 283 | $params['where'] = "$field = ?"; |
|
| 284 | ||
| 285 | return self::all($params, $value); |
|
| 286 | } |
|
| 287 | ||
| 288 | /** |
|
| 289 | * Cuenta los registros que coincidan con las condiciones indicadas. |
|