1 | <?php |
||
28 | abstract class Model extends BaseModel |
||
29 | { |
||
30 | |||
31 | use DateCreatedAttribute, DateUpdatedAttribute; |
||
32 | |||
33 | /** |
||
34 | * @event ModelEvent an event. You may set |
||
35 | * [[ModelEvent::isValid]] to be false to stop the save. |
||
36 | */ |
||
37 | const EVENT_BEFORE_SAVE = 'beforeSave'; |
||
38 | |||
39 | /** |
||
40 | * @event ModelEvent an event. You may set |
||
41 | * [[ModelEvent::isValid]] to be false to stop the save. |
||
42 | */ |
||
43 | const EVENT_AFTER_SAVE = 'afterSave'; |
||
44 | |||
45 | /** |
||
46 | * @event ModelEvent an event. You may set |
||
47 | * [[ModelEvent::isValid]] to be false to stop the deletion. |
||
48 | */ |
||
49 | const EVENT_BEFORE_DELETE = 'beforeDelete'; |
||
50 | |||
51 | /** |
||
52 | * @event ModelEvent an event. You may set |
||
53 | * [[ModelEvent::isValid]] to be false to stop the deletion. |
||
54 | */ |
||
55 | const EVENT_AFTER_DELETE = 'afterDelete'; |
||
56 | |||
57 | /** |
||
58 | * @var string |
||
59 | */ |
||
60 | public $uid; |
||
61 | |||
62 | /** |
||
63 | * @return bool |
||
64 | */ |
||
65 | public function isNew(): bool |
||
69 | |||
70 | /** |
||
71 | * @inheritdoc |
||
72 | */ |
||
73 | public function rules() |
||
100 | |||
101 | /** |
||
102 | * @inheritdoc |
||
103 | */ |
||
104 | public function attributes() |
||
115 | |||
116 | /** |
||
117 | * @inheritdoc |
||
118 | */ |
||
119 | public function attributeLabels() |
||
131 | |||
132 | /** |
||
133 | * @inheritdoc |
||
134 | */ |
||
135 | public function fields() |
||
146 | |||
147 | /** |
||
148 | * @inheritdoc |
||
149 | */ |
||
150 | public function beforeDelete(ModelDeleteEvent $event): bool |
||
155 | |||
156 | /** |
||
157 | * @inheritdoc |
||
158 | */ |
||
159 | public function afterDelete(ModelDeleteEvent $event): bool |
||
164 | |||
165 | /** |
||
166 | * @inheritdoc |
||
167 | */ |
||
168 | public function beforeSave(ModelSaveEvent $event): bool |
||
173 | |||
174 | /** |
||
175 | * @inheritdoc |
||
176 | */ |
||
177 | public function afterSave(ModelSaveEvent $event): bool |
||
182 | } |
||
183 |