Exemplo n.º 1
0
 /**
  * Execute a batch of operations of one type.
  *
  * @param int $type               type of the operations to be executed
  * @param Operation[] $operations list of same type operations
  *
  * @throws \Exception
  */
 protected function executeBatch($type, $operations)
 {
     switch ($type) {
         case Operation::ADD_NODE:
             $this->transport->storeNodes($operations);
             break;
         case Operation::MOVE_NODE:
             $this->transport->moveNodes($operations);
             break;
         case Operation::REMOVE_NODE:
             $this->transport->deleteNodes($operations);
             break;
         case Operation::REMOVE_PROPERTY:
             $this->transport->deleteProperties($operations);
             break;
         default:
             throw new \Exception('internal error: unknown operation "' . $type . '"');
     }
 }