class TranslationRepository 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)

Count entities using a Criteria object or a simple filter array.

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.

findDefault()

Get single default translation.

ArrayCollection
findAllAvailable()

Get all available translations.

boolean
exists(string $locale)

No description

array
getAvailableLocales()

Get all available locales.

array
getAvailableOverrideLocales()

Get all available locales.

ArrayCollection
findByLocaleAndAvailable($locale)

Get all available translations by locale.

ArrayCollection
findByOverrideLocaleAndAvailable($overrideLocale)

Get all available translations by overrideLocale.

findOneByLocaleAndAvailable($locale)

Get one available translation by locale.

findOneByOverrideLocaleAndAvailable($overrideLocale)

Get one available translation by overrideLocale.

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)

Count entities using a Criteria object or a simple filter array.

Parameters

Criteria|mixed|array $criteria or array

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

Translation findDefault()

Get single default translation.

Return Value

Translation

ArrayCollection findAllAvailable()

Get all available translations.

Return Value

ArrayCollection

boolean exists(string $locale)

Parameters

string $locale

Return Value

boolean

array getAvailableLocales()

Get all available locales.

Return Value

array

array getAvailableOverrideLocales()

Get all available locales.

Return Value

array

ArrayCollection findByLocaleAndAvailable($locale)

Get all available translations by locale.

Parameters

$locale

Return Value

ArrayCollection

ArrayCollection findByOverrideLocaleAndAvailable($overrideLocale)

Get all available translations by overrideLocale.

Parameters

$overrideLocale

Return Value

ArrayCollection

Translation findOneByLocaleAndAvailable($locale)

Get one available translation by locale.

Parameters

$locale

Return Value

Translation

Exceptions

NonUniqueResultException

Translation findOneByOverrideLocaleAndAvailable($overrideLocale)

Get one available translation by overrideLocale.

Parameters

$overrideLocale

Return Value

Translation

Exceptions

NonUniqueResultException