eZ\Publish\Core\FieldType\RichText\Type::getRelations PHP Метод

getRelations() публичный Метод

Not intended for \eZ\Publish\API\Repository\Values\Content\Relation::COMMON type relations, there is a service API for handling those.
public getRelations ( eZ\Publish\SPI\FieldType\Value $value ) : array
$value eZ\Publish\SPI\FieldType\Value
Результат array Hash with relation type as key and array of destination content ids as value. Example: array( \eZ\Publish\API\Repository\Values\Content\Relation::LINK => array( "contentIds" => array( 12, 13, 14 ), "locationIds" => array( 24 ) ), \eZ\Publish\API\Repository\Values\Content\Relation::EMBED => array( "contentIds" => array( 12 ), "locationIds" => array( 24, 45 ) ), \eZ\Publish\API\Repository\Values\Content\Relation::ATTRIBUTE => array( 12 ) )
    public function getRelations(SPIValue $value)
    {
        $relations = array();
        /** @var \eZ\Publish\Core\FieldType\RichText\Value $value */
        if ($value->xml instanceof DOMDocument) {
            $relations = array(Relation::LINK => $this->getRelatedObjectIds($value, Relation::LINK), Relation::EMBED => $this->getRelatedObjectIds($value, Relation::EMBED));
        }
        return $relations;
    }