| 1 | <?php |
||
| 7 | class DateTime extends AbstractDateTime implements SanitizeRuleInterface |
||
| 8 | { |
||
| 9 | /** @var string */ |
||
| 10 | protected $format; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @param string $format DateTime Format to use |
||
| 14 | */ |
||
| 15 | 15 | public function __construct(string $format = 'Y-m-d H:i:s') |
|
| 19 | |||
| 20 | /** |
||
| 21 | * Sanitize a datetime to a specified format, default "Y-m-d H:i:s". |
||
| 22 | * |
||
| 23 | * @param object $subject The subject to be filtered. |
||
| 24 | * @param string $field The subject field name. |
||
| 25 | * |
||
| 26 | * @return bool True if the value was sanitized, false if not. |
||
| 27 | */ |
||
| 28 | 15 | public function __invoke($subject, string $field): bool |
|
| 39 | } |
||
| 40 |