Contao Utils Bundle

EntityFinderHelper
in package

Table of Contents

Properties

$connection  : Connection
$utils  : Utils

Methods

__construct()  : mixed
fetchModelOrData()  : object|Model|null
findContentElementByInserttag()  : array<string|int, mixed>
Find content elements by insert inserttags like insert_module oder insert_article.
findModulesByInserttag()  : array<string|int, mixed>
Find frontend modules by insert inserttags like insert_module oder insert_article.
findModulesByTypeAndSerializedValue()  : Collection|null
Search within serialized array fields of the model entity.

Properties

Methods

__construct()

public __construct(Utils $utils, Connection $connection) : mixed
Parameters
$utils : Utils
$connection : Connection

fetchModelOrData()

public fetchModelOrData(string $table, int|string $idOrAlias) : object|Model|null
Parameters
$table : string
$idOrAlias : int|string
Tags
throws
Exception
Return values
object|Model|null

findContentElementByInserttag()

Find content elements by insert inserttags like insert_module oder insert_article.

public findContentElementByInserttag(string $type, string $field, string $inserttag, int $id) : array<string|int, mixed>
Parameters
$type : string

The element type

$field : string

The tl_content field

$inserttag : string

The inserttag to search for, for example insert_module

$id : int

The element id to search for, for example the module id (as used in {{insert_module::1}}, would be 1 in this case)

Tags
throws
Exception
Return values
array<string|int, mixed>

The found content element ids

findModulesByInserttag()

Find frontend modules by insert inserttags like insert_module oder insert_article.

public findModulesByInserttag(string $type, string $field, string $inserttag, int $id) : array<string|int, mixed>
Parameters
$type : string

The module type

$field : string

The tl_module field

$inserttag : string

The inserttag to search for, for example insert_module

$id : int

The element id to search for, for example the module id (as used in {{insert_module::1}}, would be 1 in this case)

Tags
throws
Exception
Return values
array<string|int, mixed>

The found module ids

findModulesByTypeAndSerializedValue()

Search within serialized array fields of the model entity.

public findModulesByTypeAndSerializedValue(string $type, string $field, array<string|int, mixed> $values) : Collection|null
Parameters
$type : string

Module type

$field : string

Field with serialized data

$values : array<string|int, mixed>

Values to search for in serialized data field

Tags
throws
Exception
Return values
Collection|null

        
On this page

Search results