class TagRepository extends EntityRepository (View source)

[email protected]}

Constants

NODE_ALIAS

Alias for DQL and Query builder representing Node relation.

NODESSOURCES_ALIAS

Alias for DQL and Query builder representing NodesSources relation.

TRANSLATION_ALIAS

Alias for DQL and Query builder representing Translation relation.

TAG_ALIAS

Alias for DQL and Query builder representing Tag relation.

Properties

protected array $searchableTypes Doctrine column types that can be search with LIKE feature. from EntityRepository

Methods

string
buildComparison(mixed $value, string $prefix, string $key, string $baseKey, QueryBuilder $qb)

Build a query comparison.

QueryBuilder
directComparison(array $criteria, QueryBuilder $qb, string $alias)

Direct bind parameters without preparation.

QueryBuilder
prepareComparisons(array $criteria, QueryBuilder $qb, string $alias)

No description

applyComparisons(array $criteria, Query $finalQuery)

No description

QueryBuilder
singleDirectComparison(string $key, mixed $value, QueryBuilder $qb, string $alias)

Direct bind one single parameter without preparation.

Func
directExprIn(QueryBuilder $qb, string $name, string $key, array $value)

No description

applyComparison(string $key, mixed $value, Query $finalQuery)

Bind classic parameters to your query.

integer
countBy(Criteria|mixed|array $criteria, Translation $translation = null)

Just like the countBy method but with relational criteria.

classicLikeComparison(string $pattern, QueryBuilder $qb, string $alias = "obj")

Create a LIKE comparison with entity texts colunms.

QueryBuilder
createSearchBy(string $pattern, QueryBuilder $qb, array $criteria = [], string $alias = "obj")

Create a Criteria object from a search pattern and additionnal fields.

array|Paginator
searchBy(string $pattern, array $criteria = [], array $orders = [], integer $limit = null, integer $offset = null)

No description

int
countSearchBy(string $pattern, array $criteria = [])

No description

buildTagFiltering(array $criteria, QueryBuilder $qb, string $nodeAlias = 'n')

No description

applyFilterByTag(array $criteria, Query $finalQuery)

Bind tag parameters to final query

boolean
hasJoinedNode(QueryBuilder $qb, string $alias)

Ensure that node table is joined only once.

boolean
hasJoinedNodesSources(QueryBuilder $qb, string $alias)

Ensure that nodes_sources table is joined only once.

filterByNodes(array $criteria, QueryBuilder $qb)

Add a node filtering to queryBuilder.

applyFilterByNodes(array $criteria, Query $finalQuery)

Bind node parameter to final query

filterByCriteria(array $criteria, QueryBuilder $qb)

Reimplementing findBy features… with extra things

applyFilterByCriteria(array $criteria, Query $finalQuery)

Bind parameters to generated query.

filterByTranslation(array $criteria, QueryBuilder $qb, Translation $translation = null)

Create filters according to any translation criteria OR argument.

applyTranslationByTag(array $criteria, Query $finalQuery, Translation $translation = null)

Bind translation parameter to final query

QueryBuilder
getContextualQueryWithTranslation(array $criteria, array $orderBy = null, integer|null $limit = null, integer|null $offset = null, Translation $translation = null)

This method allows to pre-filter Nodes with a given translation.

QueryBuilder
getCountContextualQueryWithTranslation(array $criteria, Translation $translation = null)

This method allows to pre-filter Nodes with a given translation.

array|Paginator
findBy(array $criteria, array $orderBy = null, integer|null $limit = null, integer|null $offset = null, Translation $translation = null)

Just like the findBy method but with relational criteria.

Tag|null
findOneBy(array $criteria, array $orderBy = null, Translation $translation = null)

Just like the findOneBy method but with relational criteria.

Tag|null
findWithTranslation(integer $tagId, Translation $translation)

No description

array
findAllWithTranslation(Translation $translation)

No description

Tag|null
findWithDefaultTranslation(integer $tagId)

No description

array
array
findByParentWithTranslation(Translation $translation, Tag $parent = null)

No description

array
findByParentWithDefaultTranslation(Tag $parent = null)

No description

Tag
findOrCreateByPath(string $tagPath)

Find a tag according to the given path or create it.

Tag|null
findByPath(string $tagPath)

Find a tag according to the given path.

int
findLatestPositionInParent(Tag $parentTag = null)

Get latest position in parent.

Details

protected string buildComparison(mixed $value, string $prefix, string $key, string $baseKey, QueryBuilder $qb)

Build a query comparison.

Parameters

mixed $value
string $prefix The prefix should always end with a dot
string $key
string $baseKey
QueryBuilder $qb

Return Value

string

protected QueryBuilder directComparison(array $criteria, QueryBuilder $qb, string $alias)

Direct bind parameters without preparation.

Parameters

array $criteria
QueryBuilder $qb
string $alias

Return Value

QueryBuilder

protected QueryBuilder prepareComparisons(array $criteria, QueryBuilder $qb, string $alias)

Parameters

array $criteria
QueryBuilder $qb
string $alias

Return Value

QueryBuilder

protected applyComparisons(array $criteria, Query $finalQuery)

Parameters

array $criteria
Query $finalQuery

protected QueryBuilder singleDirectComparison(string $key, mixed $value, QueryBuilder $qb, string $alias)

Direct bind one single parameter without preparation.

Parameters

string $key
mixed $value
QueryBuilder $qb
string $alias

Return Value

QueryBuilder

protected Func directExprIn(QueryBuilder $qb, string $name, string $key, array $value)

Parameters

QueryBuilder $qb &$qb
string $name
string $key
array $value

Return Value

Func

protected applyComparison(string $key, mixed $value, Query $finalQuery)

Bind classic parameters to your query.

Parameters

string $key
mixed $value
Query $finalQuery

integer countBy(Criteria|mixed|array $criteria, Translation $translation = null)

Just like the countBy method but with relational criteria.

Parameters

Criteria|mixed|array $criteria or array
Translation $translation

Return Value

integer

protected classicLikeComparison(string $pattern, QueryBuilder $qb, string $alias = "obj")

Create a LIKE comparison with entity texts colunms.

Parameters

string $pattern
QueryBuilder $qb
string $alias

protected QueryBuilder createSearchBy(string $pattern, QueryBuilder $qb, array $criteria = [], string $alias = "obj")

Create a Criteria object from a search pattern and additionnal fields.

Parameters

string $pattern Search pattern
QueryBuilder $qb QueryBuilder to pass
array $criteria Additionnal criteria
string $alias SQL query table alias

Return Value

QueryBuilder

array|Paginator searchBy(string $pattern, array $criteria = [], array $orders = [], integer $limit = null, integer $offset = null)

Parameters

string $pattern Search pattern
array $criteria Additionnal criteria
array $orders
integer $limit
integer $offset

Return Value

array|Paginator

int countSearchBy(string $pattern, array $criteria = [])

Parameters

string $pattern Search pattern
array $criteria Additionnal criteria

Return Value

int

protected buildTagFiltering(array $criteria, QueryBuilder $qb, string $nodeAlias = 'n')

Parameters

array $criteria &$criteria
QueryBuilder $qb
string $nodeAlias

protected applyFilterByTag(array $criteria, Query $finalQuery)

Bind tag parameters to final query

Parameters

array $criteria
Query $finalQuery

protected boolean hasJoinedNode(QueryBuilder $qb, string $alias)

Ensure that node table is joined only once.

Parameters

QueryBuilder $qb
string $alias

Return Value

boolean

protected boolean hasJoinedNodesSources(QueryBuilder $qb, string $alias)

Ensure that nodes_sources table is joined only once.

Parameters

QueryBuilder $qb
string $alias

Return Value

boolean

protected filterByNodes(array $criteria, QueryBuilder $qb)

Add a node filtering to queryBuilder.

Parameters

array $criteria
QueryBuilder $qb

protected applyFilterByNodes(array $criteria, Query $finalQuery)

Bind node parameter to final query

Parameters

array $criteria
Query $finalQuery

protected filterByCriteria(array $criteria, QueryBuilder $qb)

Reimplementing findBy features… with extra things

  • key => array('<=', $value)
  • key => array('<', $value)
  • key => array('>=', $value)
  • key => array('>', $value)
  • key => array('BETWEEN', $value, $value)
  • key => array('LIKE', $value)
  • key => array('NOT IN', $array)
  • key => 'NOT NULL'

You can filter with translations relation, examples:

  • translation => $object
  • translation.locale => 'fr_FR'

Parameters

array $criteria
QueryBuilder $qb

protected applyFilterByCriteria(array $criteria, Query $finalQuery)

Bind parameters to generated query.

Parameters

array $criteria
Query $finalQuery

protected filterByTranslation(array $criteria, QueryBuilder $qb, Translation $translation = null)

Create filters according to any translation criteria OR argument.

Parameters

array $criteria
QueryBuilder $qb
Translation $translation

protected applyTranslationByTag(array $criteria, Query $finalQuery, Translation $translation = null)

Bind translation parameter to final query

Parameters

array $criteria
Query $finalQuery
Translation $translation

protected QueryBuilder getContextualQueryWithTranslation(array $criteria, array $orderBy = null, integer|null $limit = null, integer|null $offset = null, Translation $translation = null)

This method allows to pre-filter Nodes with a given translation.

Parameters

array $criteria
array $orderBy
integer|null $limit
integer|null $offset
Translation $translation

Return Value

QueryBuilder

protected QueryBuilder getCountContextualQueryWithTranslation(array $criteria, Translation $translation = null)

This method allows to pre-filter Nodes with a given translation.

Parameters

array $criteria
Translation $translation

Return Value

QueryBuilder

array|Paginator findBy(array $criteria, array $orderBy = null, integer|null $limit = null, integer|null $offset = null, Translation $translation = null)

Just like the findBy method but with relational criteria.

Parameters

array $criteria
array $orderBy
integer|null $limit
integer|null $offset
Translation $translation

Return Value

array|Paginator

Tag|null findOneBy(array $criteria, array $orderBy = null, Translation $translation = null)

Just like the findOneBy method but with relational criteria.

Parameters

array $criteria
array $orderBy
Translation $translation

Return Value

Tag|null

Tag|null findWithTranslation(integer $tagId, Translation $translation)

Parameters

integer $tagId
Translation $translation

Return Value

Tag|null

array findAllWithTranslation(Translation $translation)

Parameters

Translation $translation

Return Value

array

Tag|null findWithDefaultTranslation(integer $tagId)

Parameters

integer $tagId

Return Value

Tag|null

array findAllWithDefaultTranslation()

Return Value

array

array findByParentWithTranslation(Translation $translation, Tag $parent = null)

Parameters

Translation $translation
Tag $parent

Return Value

array

array findByParentWithDefaultTranslation(Tag $parent = null)

Parameters

Tag $parent

Return Value

array

Tag findOrCreateByPath(string $tagPath)

Find a tag according to the given path or create it.

Parameters

string $tagPath

Return Value

Tag

Tag|null findByPath(string $tagPath)

Find a tag according to the given path.

Parameters

string $tagPath

Return Value

Tag|null

int findLatestPositionInParent(Tag $parentTag = null)

Get latest position in parent.

Parent can be null for tag root

Parameters

Tag $parentTag [description]

Return Value

int