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