Loads data of related to/from $contentId.
abstract public loadRelations ( integer $contentId, integer $contentVersionNo = null, integer $relationType = null ) : mixed[][] | ||
$contentId | integer | |
$contentVersionNo | integer | |
$relationType | integer | |
return | mixed[][] | Content data, array structured like {@see \eZ\Publish\Core\Persistence\Legacy\Content\Gateway::load()} |
/** * Loads data of related to/from $contentId * * @param int $contentId * @param int $contentVersionNo * @param int $relationType * * @return mixed[][] Content data, array structured like {@see \eZ\Publish\Core\Persistence\Legacy\Content\Gateway::load()} */ public function loadRelations($contentId, $contentVersionNo = null, $relationType = null) { try { return $this->innerGateway->loadRelations($contentId, $contentVersionNo, $relationType); } catch (DBALException $e) { throw new RuntimeException('Database error', 0, $e); } catch (PDOException $e) { throw new RuntimeException('Database error', 0, $e); } }
/** * Loads relations from $sourceContentId. Optionally, loads only those with $type and $sourceContentVersionNo. * * @param mixed $sourceContentId Source Content ID * @param mixed|null $sourceContentVersionNo Source Content Version, null if not specified * @param int|null $type {@see \eZ\Publish\API\Repository\Values\Content\Relation::COMMON, * \eZ\Publish\API\Repository\Values\Content\Relation::EMBED, * \eZ\Publish\API\Repository\Values\Content\Relation::LINK, * \eZ\Publish\API\Repository\Values\Content\Relation::FIELD} * * @return \eZ\Publish\SPI\Persistence\Content\Relation[] */ public function loadRelations($sourceContentId, $sourceContentVersionNo = null, $type = null) { return $this->mapper->extractRelationsFromRows($this->contentGateway->loadRelations($sourceContentId, $sourceContentVersionNo, $type)); }