We might want to cache this, since this method is used by about every
method in the location handler.
abstract public getBasicNodeData ( mixed $nodeId ) : array | ||
$nodeId | mixed | |
Résultat | array |
/** * Returns an array with basic node data * * We might want to cache this, since this method is used by about every * method in the location handler. * * @todo optimize * @param mixed $nodeId * * @return array */ public function getBasicNodeData($nodeId) { try { return $this->innerGateway->getBasicNodeData($nodeId); } catch (DBALException $e) { throw new RuntimeException('Database error', 0, $e); } catch (PDOException $e) { throw new RuntimeException('Database error', 0, $e); } }
/** * Creates a new location rooted at $location->parentId. * * @param \eZ\Publish\SPI\Persistence\Content\Location\CreateStruct $createStruct * * @return \eZ\Publish\SPI\Persistence\Content\Location */ public function create(CreateStruct $createStruct) { $parentNodeData = $this->locationGateway->getBasicNodeData($createStruct->parentId); $locationStruct = $this->locationGateway->create($createStruct, $parentNodeData); $this->locationGateway->createNodeAssignment($createStruct, $parentNodeData['node_id'], LocationGateway::NODE_ASSIGNMENT_OP_CODE_CREATE_NOP); return $locationStruct; }
/** * Set section on all content objects in the subtree. * * @param mixed $locationId * @param mixed $sectionId */ public function setSectionForSubtree($locationId, $sectionId) { $nodeData = $this->locationGateway->getBasicNodeData($locationId); $this->locationGateway->setSectionForSubtree($nodeData['path_string'], $sectionId); }