1 | <?php |
||
18 | abstract class AbstractSaveableConnection extends Model implements SavableConnectionInterface |
||
19 | { |
||
20 | /** |
||
21 | * @event ModelEvent The event that is triggered before the component is saved |
||
22 | * You may set [[ModelEvent::isValid]] to `false` to prevent the component from getting saved. |
||
23 | */ |
||
24 | const EVENT_BEFORE_SAVE = 'beforeSave'; |
||
25 | |||
26 | /** |
||
27 | * @event ModelEvent The event that is triggered after the component is saved |
||
28 | */ |
||
29 | const EVENT_AFTER_SAVE = 'afterSave'; |
||
30 | |||
31 | /** |
||
32 | * @event ModelEvent The event that is triggered before the component is deleted |
||
33 | * You may set [[ModelEvent::isValid]] to `false` to prevent the component from getting deleted. |
||
34 | */ |
||
35 | const EVENT_BEFORE_DELETE = 'beforeDelete'; |
||
36 | |||
37 | /** |
||
38 | * @event \yii\base\Event The event that is triggered after the component is deleted |
||
39 | */ |
||
40 | const EVENT_AFTER_DELETE = 'afterDelete'; |
||
41 | |||
42 | /** |
||
43 | * @inheritdoc |
||
44 | */ |
||
45 | public function beforeSave(bool $isNew): bool |
||
54 | |||
55 | /** |
||
56 | * @inheritdoc |
||
57 | */ |
||
58 | public function afterSave(bool $isNew, array $changedAttributes) |
||
66 | |||
67 | /** |
||
68 | * @inheritdoc |
||
69 | */ |
||
70 | public function beforeDelete(): bool |
||
77 | |||
78 | /** |
||
79 | * @inheritdoc |
||
80 | */ |
||
81 | public function afterDelete() |
||
87 | } |
||
88 |