| 1 | <?php |
||
| 10 | class DateBehaviour extends AbstractBehaviour |
||
| 11 | { |
||
| 12 | /** @var string */ |
||
| 13 | private $createdAtField; |
||
| 14 | |||
| 15 | /** @var string */ |
||
| 16 | private $updatedAtField; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @param string $createdAtField |
||
| 20 | * @param string $updatedAtField |
||
| 21 | */ |
||
| 22 | public function __construct(string $createdAtField = 'created_at', string $updatedAtField = 'updated_at') |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @param array $data |
||
| 30 | * @return array |
||
| 31 | */ |
||
| 32 | public function beforeInsert(array $data): array |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @param ActiveRow $record |
||
| 46 | * @param array $data |
||
| 47 | * @return array |
||
| 48 | */ |
||
| 49 | public function beforeUpdate(ActiveRow $record, array $data): array |
||
| 56 | } |
||
| 57 |