Example #1
0
 public function behaviors()
 {
     return [['class' => NestedSetBehavior::className(), 'hasManyRoots' => true]];
 }
Example #2
0
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     return [['class' => NestedSetBehavior::className(), 'hasManyRoots' => true], 'timestamp' => ['class' => 'yii\\behaviors\\TimestampBehavior', 'attributes' => [ActiveRecord::EVENT_BEFORE_INSERT => ['created_at', 'updated_at'], ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at']]]];
 }