Esempio n. 1
0
 /**
  * Perform the move operation.
  *
  * @return \AwatBayazidi\Foundation\Tree\Node
  */
 public function perform()
 {
     $this->guardAgainstImpossibleMove();
     if ($this->fireMoveEvent('moving') === false) {
         return $this->node;
     }
     if ($this->hasChange()) {
         $self = $this;
         $this->node->getConnection()->transaction(function () use($self) {
             $self->updateStructure();
         });
         $this->target->reload();
         $this->node->setDepthWithSubtree();
         $this->node->reload();
     }
     $this->fireMoveEvent('moved', false);
     return $this->node;
 }