1 | <?php |
||
8 | class DateBehaviour extends AbstractBehaviour |
||
9 | { |
||
10 | /** @var string */ |
||
11 | private $createdAtField; |
||
12 | |||
13 | /** @var string */ |
||
14 | private $updatedAtField; |
||
15 | |||
16 | /** |
||
17 | * @param string $createdAtField |
||
18 | * @param string $updatedAtField |
||
19 | */ |
||
20 | 68 | public function __construct(string $createdAtField = 'created_at', string $updatedAtField = 'updated_at') |
|
25 | |||
26 | /** |
||
27 | * @param array $data |
||
28 | * @return array |
||
29 | */ |
||
30 | 2 | public function beforeInsert(array $data): array |
|
41 | |||
42 | /** |
||
43 | * @param ActiveRow $record |
||
44 | * @param array $data |
||
45 | * @return array |
||
46 | */ |
||
47 | 2 | public function beforeUpdate(ActiveRow $record, array $data): array |
|
54 | } |
||
55 |