createRelationFromCreateStruct() public method

Creates a Content from the given $struct.
public createRelationFromCreateStruct ( eZ\Publish\SPI\Persistence\Content\Relation\CreateStruct $struct ) : eZ\Publish\SPI\Persistence\Content\Relation
$struct eZ\Publish\SPI\Persistence\Content\Relation\CreateStruct
return eZ\Publish\SPI\Persistence\Content\Relation
コード例 #1
0
ファイル: Handler.php プロジェクト: Pixy/ezpublish-kernel
 /**
  * Creates a relation between $sourceContentId in $sourceContentVersionNo
  * and $destinationContentId with a specific $type.
  *
  * @todo Should the existence verifications happen here or is this supposed to be handled at a higher level?
  *
  * @param \eZ\Publish\SPI\Persistence\Content\Relation\CreateStruct $createStruct
  *
  * @return \eZ\Publish\SPI\Persistence\Content\Relation
  */
 public function addRelation(RelationCreateStruct $createStruct)
 {
     $relation = $this->mapper->createRelationFromCreateStruct($createStruct);
     $relation->id = $this->contentGateway->insertRelation($createStruct);
     return $relation;
 }