/** * Implement the workspace removeItem method. * * @param string $absPath the absolute path of the item to be removed * * @see Workspace::removeItem */ public function removeItemImmediately($absPath) { if (!$this->transport instanceof WritingInterface) { throw new UnsupportedRepositoryOperationException('Transport does not support writing'); } $absPath = PathHelper::normalizePath($absPath); $item = $this->session->getItem($absPath); // update local state and cached objects about disappeared nodes if ($item instanceof NodeInterface) { $this->performNodeRemove($absPath, $item, false); $this->cascadeDelete($absPath, false); } else { $this->performPropertyRemove($absPath, $item, false); } $item->setDeleted(); }
/** * @param EventInterface $event * * @return bool */ private function skipByNodeTypes(EventInterface $event) { if (!($path = $event->getPath())) { // Some events (like PERSIST) do not provide an identifier return true; } try { $node = $this->session->getItem($path); } catch (PathNotFoundException $e) { return true; } if ($node instanceof PropertyInterface) { $node = $node->getParent(); } foreach ($this->nodeTypes as $typename) { if ($node->isNodeType($typename)) { return false; } } return true; }