/**
  * @param int $left
  * @param int $right
  * @return array|null
  */
 protected function findInsertAfterRange(&$left, &$right)
 {
     $result = null;
     $left = $this->node->getAttribute($this->rightAttribute);
     $right = $this->getNodeBehavior()->getNext()->select($this->leftAttribute)->scalar();
     if ($right === false) {
         $result = $this->getNodeBehavior()->getParent()->select([$this->leftAttribute, $this->rightAttribute])->createCommand()->queryOne();
         $right = $result[$this->rightAttribute];
     }
     $right = (int) $right;
     return $result;
 }
Пример #2
0
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     return [BlameableBehavior::className(), TimestampBehavior::className(), 'sluggable' => ['class' => SluggableBehavior::className(), 'attribute' => 'title'], 'multilingual' => ['class' => MultilingualBehavior::className(), 'langForeignKey' => 'post_category_id', 'tableName' => "{{%post_category_lang}}", 'attributes' => ['title', 'description']], 'nestedInterval' => ['class' => NestedIntervalsBehavior::className(), 'leftAttribute' => 'left_border', 'rightAttribute' => 'right_border', 'amountOptimize' => '25', 'noPrepend' => true]];
 }
Пример #3
0
 /**
  * @return array
  */
 public function behaviors()
 {
     return [['class' => NestedIntervalsBehavior::className()]];
 }
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     return ['tree' => ['class' => NestedIntervalsBehavior::className(), 'treeAttribute' => 'tree']];
 }
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     return ['tree' => ['class' => NestedIntervalsBehavior::className(), 'treeAttribute' => 'tree', 'range' => [0, 9223372036854775807]]];
 }
Пример #6
0
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     return [['class' => AdjacencyListBehavior::className(), 'sortable' => false], ['class' => NestedIntervalsBehavior::className(), 'treeAttribute' => 'tree']];
 }