Jackalope\Transport\DoctrineDBAL\Client::moveNodeImmediately PHP Method

moveNodeImmediately() public method

{@inheritDoc}
public moveNodeImmediately ( $srcAbsPath, $dstAbspath )
    public function moveNodeImmediately($srcAbsPath, $dstAbspath)
    {
        $this->prepareSave();
        $this->moveNode($srcAbsPath, $dstAbspath);
        $this->finishSave();
        return true;
    }

Usage Example

 /**
  * Test cases for depth when moving nodes
  */
 public function testDepthOnMove()
 {
     $root = $this->session->getNode('/');
     $topic1 = $root->addNode('topic1');
     $topic2 = $root->addNode('topic2');
     $topic3 = $root->addNode('topic3');
     $topic1->addNode('page1');
     $topic2->addNode('page2');
     $topic3->addNode('page3');
     $this->session->save();
     $this->transport->moveNodeImmediately('/topic2/page2', '/topic1/page1/page2');
     $this->transport->moveNodeImmediately('/topic3', '/topic1/page1/page2/topic3');
     $conn = $this->getConnection();
     $qb = $conn->createQueryBuilder();
     $qb->select('local_name, depth')->from('phpcr_nodes', 'n')->where('n.path = :path');
     $query = $qb->getSql();
     $stmnt = $this->conn->executeQuery($query, array('path' => '/topic1/page1/page2'));
     $row = $stmnt->fetch();
     $this->assertEquals($row['depth'], '3');
     $stmnt = $this->conn->executeQuery($query, array('path' => '/topic1/page1/page2/topic3/page3'));
     $row = $stmnt->fetch();
     $this->assertEquals($row['depth'], '5');
 }
All Usage Examples Of Jackalope\Transport\DoctrineDBAL\Client::moveNodeImmediately