1 | <?php |
||
18 | class ActiveRecord extends \yii\db\ActiveRecord |
||
19 | { |
||
20 | use BeforeQueryTrait; |
||
21 | |||
22 | //Status state |
||
23 | const STATUS_UNLOCK = 0; |
||
24 | const STATUS_LOCK = 1; //Blocking records |
||
25 | |||
26 | public static $BEFORE_QUERY = ['locked' => self::STATUS_UNLOCK]; |
||
27 | |||
28 | |||
29 | // Dynamical fields for behaviors |
||
30 | /** |
||
31 | * @var string the attribute that will receive timestamp value |
||
32 | * Set this property to false if you do not want to record the creation time. |
||
33 | */ |
||
34 | public $createdAtAttribute = 'created_at'; |
||
35 | /** |
||
36 | * @var string the attribute that will receive timestamp value. |
||
37 | * Set this property to false if you do not want to record the update time. |
||
38 | */ |
||
39 | public $updatedAtAttribute = 'updated_at'; |
||
40 | |||
41 | /** |
||
42 | * @var string the attribute that will receive current user ID value |
||
43 | * Set this property to false if you do not want to record the creator ID. |
||
44 | */ |
||
45 | public $createdByAttribute = 'created_by'; |
||
46 | /** |
||
47 | * @var string the attribute that will receive current user ID value |
||
48 | * Set this property to false if you do not want to record the updater ID. |
||
49 | */ |
||
50 | public $updatedByAttribute = 'updated_by'; |
||
51 | |||
52 | public $lockedAttribute = 'locked'; |
||
53 | |||
54 | public $removedAttribute = 'removed'; |
||
55 | |||
56 | |||
57 | public function behaviors() |
||
115 | |||
116 | public function isNestedSet(){ |
||
119 | |||
120 | /** |
||
121 | * Duplicate entries in the table. |
||
122 | * @return $this|null |
||
123 | */ |
||
124 | public function duplicate() { |
||
136 | } |
||
137 |