create() 추상적인 공개 메소드

Creates a new location in given $parentNode.
abstract public create ( eZ\Publish\SPI\Persistence\Content\Location\CreateStruct $createStruct, array $parentNode ) : eZ\Publish\SPI\Persistence\Content\Location
$createStruct eZ\Publish\SPI\Persistence\Content\Location\CreateStruct
$parentNode array
리턴 eZ\Publish\SPI\Persistence\Content\Location
예제 #1
0
 /**
  * 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;
 }
예제 #2
0
 /**
  * Creates a new location in given $parentNode
  *
  * @param \eZ\Publish\SPI\Persistence\Content\Location\CreateStruct $createStruct
  * @param array $parentNode
  *
  * @return \eZ\Publish\SPI\Persistence\Content\Location
  */
 public function create(CreateStruct $createStruct, array $parentNode)
 {
     try {
         return $this->innerGateway->create($createStruct, $parentNode);
     } catch (DBALException $e) {
         throw new RuntimeException('Database error', 0, $e);
     } catch (PDOException $e) {
         throw new RuntimeException('Database error', 0, $e);
     }
 }