Loads data of related to/from $contentId.
abstract public loadReverseRelations ( integer $contentId, integer $relationType = null ) : mixed[][] | ||
$contentId | 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 boolean $reverse Reverse relation, default false * @param int $contentVersionNo * @param int $relationType * * @return mixed[][] Content data, array structured like {@see \eZ\Publish\Core\Persistence\Legacy\Content\Gateway::load()} */ public function loadReverseRelations($contentId, $relationType = null) { try { return $this->innerGateway->loadReverseRelations($contentId, $relationType); } catch (DBALException $e) { throw new RuntimeException('Database error', 0, $e); } catch (PDOException $e) { throw new RuntimeException('Database error', 0, $e); } }
/** * Loads relations from $contentId. Optionally, loads only those with $type. * * Only loads relations against published versions. * * @param mixed $destinationContentId Destination Content ID * @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 loadReverseRelations($destinationContentId, $type = null) { return $this->mapper->extractRelationsFromRows($this->contentGateway->loadReverseRelations($destinationContentId, $type)); }