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