Ejemplo n.º 1
0
Archivo: Move.php Proyecto: sonars/tree
 /**
  * Perform the move operation.
  *
  * @return \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;
 }