| @@ 19-29 (lines=11) @@ | ||
| 16 | self::saving([static::class, 'setAutoTimestamps']); |
|
| 17 | } |
|
| 18 | ||
| 19 | protected static function autoDefinitionAutoTimestamps(): void |
|
| 20 | { |
|
| 21 | static::$properties['created_at'] = [ |
|
| 22 | 'type' => Type::DATE, |
|
| 23 | 'validate' => 'timestamp|db_timestamp', |
|
| 24 | ]; |
|
| 25 | static::$properties['updated_at'] = [ |
|
| 26 | 'type' => Type::DATE, |
|
| 27 | 'validate' => 'timestamp|db_timestamp', |
|
| 28 | ]; |
|
| 29 | } |
|
| 30 | ||
| 31 | public static function setAutoTimestamps(AbstractEvent $event): void |
|
| 32 | { |
|
| @@ 18-28 (lines=11) @@ | ||
| 15 | */ |
|
| 16 | trait SoftDelete |
|
| 17 | { |
|
| 18 | protected static function autoDefinitionSoftDelete(): void |
|
| 19 | { |
|
| 20 | static::$properties['deleted'] = [ |
|
| 21 | 'type' => Type::BOOLEAN, |
|
| 22 | ]; |
|
| 23 | static::$properties['deleted_at'] = [ |
|
| 24 | 'type' => Type::DATE, |
|
| 25 | 'validate' => 'timestamp|db_timestamp', |
|
| 26 | 'null' => true, |
|
| 27 | ]; |
|
| 28 | } |
|
| 29 | ||
| 30 | protected function performDelete(): bool |
|
| 31 | { |
|