class RelatedExtension extends AbstractExtension (View source)

Methods

__construct(RelationRepository $relationRepository, Config $config, Query $query, ContentHelper $contentHelper)

No description

array
getFilters()

{@inheritdoc}

array
getFunctions()

{@inheritdoc}

array
getRelatedContentByType(Content $content, bool $bidirectional = true, int|null $limit = null, bool $publishedOnly = true)

No description

array
getRelatedContent(Content $content, string|null $name = null, bool $bidirectional = true, int|null $limit = null, bool $publishedOnly = true)

No description

Content|null
getFirstRelatedContent(Content $content, string|null $name = null, bool $bidirectional = true, bool $publishedOnly = true)

No description

Collection
getRelatedOptions(string $contentTypeSlug, string|null $order = null, string $format = '', bool|null $required = false)

No description

Collection
getRelatedValues(Content $source, string $contentType)

No description

Details

__construct(RelationRepository $relationRepository, Config $config, Query $query, ContentHelper $contentHelper)

Parameters

RelationRepository $relationRepository
Config $config
Query $query
ContentHelper $contentHelper

array getFilters()

{@inheritdoc}

Return Value

array

array getFunctions()

{@inheritdoc}

Return Value

array

array getRelatedContentByType(Content $content, bool $bidirectional = true, int|null $limit = null, bool $publishedOnly = true)

Parameters

Content $content
bool $bidirectional
int|null $limit
bool $publishedOnly

Return Value

array name => Content[]

array getRelatedContent(Content $content, string|null $name = null, bool $bidirectional = true, int|null $limit = null, bool $publishedOnly = true)

Parameters

Content $content
string|null $name
bool $bidirectional
int|null $limit
bool $publishedOnly

Return Value

array

Content|null getFirstRelatedContent(Content $content, string|null $name = null, bool $bidirectional = true, bool $publishedOnly = true)

Parameters

Content $content
string|null $name
bool $bidirectional
bool $publishedOnly

Return Value

Content|null

Collection getRelatedOptions(string $contentTypeSlug, string|null $order = null, string $format = '', bool|null $required = false)

Parameters

string $contentTypeSlug
string|null $order
string $format
bool|null $required

Return Value

Collection

Collection getRelatedValues(Content $source, string $contentType)

Parameters

Content $source
string $contentType

Return Value

Collection