/**
  * Insert operation internal handler
  * @param bool $forward
  * @throws Exception
  */
 protected function insertNearInternal($forward)
 {
     $this->checkNode(true);
     $this->owner->setAttribute($this->parentAttribute, $this->node->getAttribute($this->parentAttribute));
     if ($this->sortable !== false) {
         if ($forward) {
             $this->owner->moveAfter($this->node);
         } else {
             $this->owner->moveBefore($this->node);
         }
     }
 }
Ejemplo n.º 2
0
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     return ['tree' => ['class' => AdjacencyListBehavior::className(), 'parentsJoinLevels' => 0, 'childrenJoinLevels' => 0]];
 }
Ejemplo n.º 3
0
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     return [['class' => AdjacencyListBehavior::className(), 'sortable' => false], ['class' => MaterializedPathBehavior::className()]];
 }
Ejemplo n.º 4
0
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     return [['class' => AdjacencyListBehavior::className(), 'sortable' => false], ['class' => NestedSetsBehavior::className(), 'treeAttribute' => 'tree']];
 }
Ejemplo n.º 5
0
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     return [TimestampBehavior::className(), ['class' => AdjacencyListBehavior::className(), 'parentAttribute' => 'parent_id'], ['class' => NestedSetsBehavior::className(), 'treeAttribute' => null, 'leftAttribute' => 'lft', 'rightAttribute' => 'rgt', 'depthAttribute' => 'level']];
 }
Ejemplo n.º 6
0
 public function behaviors()
 {
     return [['class' => AdjacencyListBehavior::className()]];
 }