Beta version

class NodeRepository extends EntityRepository

NodeRepository

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.

Methods

int
countBy(array $criteria, Translation $translation = null, AuthorizationChecker $authorizationChecker = null, boolean $preview = false)

Just like the countBy method but with relational criteria.

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

No description

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

No description

array
findByWithTranslation(array $criteria, array $orderBy = null, integer|null $limit = null, integer|null $offset = null, Translation $translation = null, AuthorizationChecker $authorizationChecker = null)

Just like the findBy method but with a given Translation and optional AuthorizationChecker.

array|Paginator
findBy(array $criteria, array $orderBy = null, integer|null $limit = null, integer|null $offset = null, Translation $translation = null, AuthorizationChecker $authorizationChecker = null, boolean $preview = false)

Just like the findBy method but with relational criteria.

Node|null
findOneByWithTranslation(array $criteria, Translation $translation = null, AuthorizationChecker $authorizationChecker = null)

Just like the findOneBy method but with a given Translation and optional AuthorizationChecker.

null|Node
findOneBy(array $criteria, array $orderBy = null, Translation $translation = null, AuthorizationChecker $authorizationChecker = null, boolean $preview = false)

Just like the findOneBy method but with relational criteria.

Node|null
findWithTranslation(integer $nodeId, Translation $translation, AuthorizationChecker $authorizationChecker = null, boolean $preview = false)

Find one Node with its Id and a given translation.

Node|null
findWithDefaultTranslation(integer $nodeId, AuthorizationChecker $authorizationChecker = null, boolean $preview = false)

Find one Node with its Id and the default translation.

Node|null
findByNodeNameWithTranslation(string $nodeName, Translation $translation, AuthorizationChecker $authorizationChecker = null, boolean $preview = false)

Find one Node with its nodeName and a given translation.

Node|null
findByNodeNameWithDefaultTranslation(string $nodeName, AuthorizationChecker $authorizationChecker = null, boolean $preview = false)

Find one Node with its nodeName and the default translation.

Node|null
findHomeWithTranslation(Translation $translation = null, AuthorizationChecker $authorizationChecker = null, boolean $preview = false)

Find the Home node with a given translation.

Node|null
findHomeWithDefaultTranslation(AuthorizationChecker $authorizationChecker = null, boolean $preview = false)

Find the Home node with the default translation.

array
getChildrenWithTranslation(Node $node, Translation $translation, AuthorizationChecker $authorizationChecker = null, bool $preview = false)

No description

array
findByParentWithTranslation(Translation $translation, Node $parent = null, AuthorizationChecker $authorizationChecker = null, bool $preview = false)

No description

array
findByParentWithDefaultTranslation(Node $parent = null, AuthorizationChecker $authorizationChecker = null, bool $preview = false)

No description

Node|null
findOneWithUrlAlias(UrlAlias $urlAlias, AuthorizationChecker $authorizationChecker = null, bool $preview = false)

No description

Node|null
findOneWithAliasAndAvailableTranslation($urlAliasAlias, AuthorizationChecker $authorizationChecker = null, bool $preview = false)

No description

bool
exists($nodeName)

No description

array|null
findByNodeAndField(Node $node, NodeTypeField $field, AuthorizationChecker $authorizationChecker = null, bool $preview = false)

No description

array|null
findByNodeAndFieldName(Node $node, $fieldName, AuthorizationChecker $authorizationChecker = null, bool $preview = false)

No description

array|null
findByNodeAndFieldAndTranslation(Node $node, NodeTypeField $field, Translation $translation, AuthorizationChecker $authorizationChecker = null, bool $preview = false)

No description

array|null
findByNodeAndFieldNameAndTranslation(Node $node, $fieldName, Translation $translation, AuthorizationChecker $authorizationChecker = null, bool $preview = false)

No description

array
findByReverseNodeAndField(Node $node, NodeTypeField $field, AuthorizationChecker $authorizationChecker = null, bool $preview = false)

No description

array
findByReverseNodeAndFieldName(Node $node, string $fieldName, AuthorizationChecker $authorizationChecker = null, bool $preview = false)

No description

array|null
findByReverseNodeAndFieldAndTranslation(Node $node, NodeTypeField $field, Translation $translation, AuthorizationChecker $authorizationChecker = null, bool $preview = false)

No description

array|null
findByReverseNodeAndFieldNameAndTranslation(Node $node, $fieldName, Translation $translation, AuthorizationChecker $authorizationChecker = null, bool $preview = false)

No description

array
findAllOffspringIdByNode(Node $node)

No description

array|null
findAllNodeParentsBy(Node $node, array $criteria, array $orderBy = null, integer $limit = null, integer $offset = null, Translation $translation = null, AuthorizationChecker $authorizationChecker = null, bool $preview = false)

Find all node’ parents with criteria and ordering.

array
findAllParentsIdByNode(Node $node)

No description

array
findAvailableTranslationForNode(Node $node)

No description

array
findUnavailableTranslationForNode(Node $node)

No description

array
findAvailableTranslationIdForNode(Node $node)

No description

array

Details

at line 59
int countBy(array $criteria, Translation $translation = null, AuthorizationChecker $authorizationChecker = null, boolean $preview = false)

Just like the countBy method but with relational criteria.

Parameters

array $criteria or array
Translation $translation
AuthorizationChecker $authorizationChecker
boolean $preview

Return Value

int

in EntityRepository at line 460
array|Paginator searchBy(string $pattern, array $criteria = array(), array $orders = array(), 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

in EntityRepository at line 507
int countSearchBy(string $pattern, array $criteria = array())

Parameters

string $pattern Search pattern
array $criteria Additionnal criteria

Return Value

int

at line 272
array findByWithTranslation(array $criteria, array $orderBy = null, integer|null $limit = null, integer|null $offset = null, Translation $translation = null, AuthorizationChecker $authorizationChecker = null)

Just like the findBy method but with a given Translation and optional AuthorizationChecker.

If no translation nor authorizationChecker is given, the vanilla findBy method will be called instead.

Parameters

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

Return Value

array

at line 325
array|Paginator findBy(array $criteria, array $orderBy = null, integer|null $limit = null, integer|null $offset = null, Translation $translation = null, AuthorizationChecker $authorizationChecker = null, boolean $preview = false)

Just like the findBy method but with relational criteria.

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'

Or filter by tags:

  • tags => $tag1
  • tags => [$tag1, $tag2]
  • tags => [$tag1, $tag2], tagExclusive => true

Parameters

array $criteria
array $orderBy
integer|null $limit
integer|null $offset
Translation $translation
AuthorizationChecker $authorizationChecker
boolean $preview

Return Value

array|Paginator

at line 437
Node|null findOneByWithTranslation(array $criteria, Translation $translation = null, AuthorizationChecker $authorizationChecker = null)

Just like the findOneBy method but with a given Translation and optional AuthorizationChecker.

If no translation nor authorizationChecker is given, the vanilla findOneBy method will be called instead.

Parameters

array $criteria
Translation $translation
AuthorizationChecker $authorizationChecker

Return Value

Node|null

at line 461
null|Node findOneBy(array $criteria, array $orderBy = null, Translation $translation = null, AuthorizationChecker $authorizationChecker = null, boolean $preview = false)

Just like the findOneBy method but with relational criteria.

Parameters

array $criteria
array $orderBy
Translation $translation
AuthorizationChecker $authorizationChecker
boolean $preview

Return Value

null|Node

at line 503
Node|null findWithTranslation(integer $nodeId, Translation $translation, AuthorizationChecker $authorizationChecker = null, boolean $preview = false)

Find one Node with its Id and a given translation.

Parameters

integer $nodeId
Translation $translation
AuthorizationChecker $authorizationChecker When not null, only PUBLISHED node will be request or with a lower status
boolean $preview

Return Value

Node|null

at line 568
Node|null findWithDefaultTranslation(integer $nodeId, AuthorizationChecker $authorizationChecker = null, boolean $preview = false)

Find one Node with its Id and the default translation.

Parameters

integer $nodeId
AuthorizationChecker $authorizationChecker When not null, only PUBLISHED node will be request or with a lower status
boolean $preview

Return Value

Node|null

at line 603
Node|null findByNodeNameWithTranslation(string $nodeName, Translation $translation, AuthorizationChecker $authorizationChecker = null, boolean $preview = false)

Find one Node with its nodeName and a given translation.

Parameters

string $nodeName
Translation $translation
AuthorizationChecker $authorizationChecker When not null, only PUBLISHED node will be request or with a lower status
boolean $preview

Return Value

Node|null

at line 636
Node|null findByNodeNameWithDefaultTranslation(string $nodeName, AuthorizationChecker $authorizationChecker = null, boolean $preview = false)

Find one Node with its nodeName and the default translation.

Parameters

string $nodeName
AuthorizationChecker $authorizationChecker When not null, only PUBLISHED node will be request or with a lower status
boolean $preview

Return Value

Node|null

at line 669
Node|null findHomeWithTranslation(Translation $translation = null, AuthorizationChecker $authorizationChecker = null, boolean $preview = false)

Find the Home node with a given translation.

Parameters

Translation $translation
AuthorizationChecker $authorizationChecker When not null, only PUBLISHED node will be request or with a lower status
boolean $preview

Return Value

Node|null

at line 704
Node|null findHomeWithDefaultTranslation(AuthorizationChecker $authorizationChecker = null, boolean $preview = false)

Find the Home node with the default translation.

Parameters

AuthorizationChecker $authorizationChecker When not null, only PUBLISHED node will be request or with a lower status
boolean $preview

Return Value

Node|null

at line 735
array getChildrenWithTranslation(Node $node, Translation $translation, AuthorizationChecker $authorizationChecker = null, bool $preview = false)

Parameters

Node $node
Translation $translation
AuthorizationChecker $authorizationChecker
bool $preview

Return Value

array

at line 751
array findByParentWithTranslation(Translation $translation, Node $parent = null, AuthorizationChecker $authorizationChecker = null, bool $preview = false)

Parameters

Translation $translation
Node $parent
AuthorizationChecker $authorizationChecker
bool $preview

Return Value

array

at line 786
array findByParentWithDefaultTranslation(Node $parent = null, AuthorizationChecker $authorizationChecker = null, bool $preview = false)

Parameters

Node $parent
AuthorizationChecker $authorizationChecker
bool $preview

Return Value

array

at line 821
Node|null findOneWithUrlAlias(UrlAlias $urlAlias, AuthorizationChecker $authorizationChecker = null, bool $preview = false)

Parameters

UrlAlias $urlAlias
AuthorizationChecker $authorizationChecker
bool $preview

Return Value

Node|null

Exceptions

NonUniqueResultException

at line 849
Node|null findOneWithAliasAndAvailableTranslation($urlAliasAlias, AuthorizationChecker $authorizationChecker = null, bool $preview = false)

Parameters

$urlAliasAlias
AuthorizationChecker $authorizationChecker
bool $preview

Return Value

Node|null

Exceptions

NonUniqueResultException

at line 906
bool exists($nodeName)

Parameters

$nodeName

Return Value

bool

at line 927
array|null findByNodeAndField(Node $node, NodeTypeField $field, AuthorizationChecker $authorizationChecker = null, bool $preview = false)

Parameters

Node $node
NodeTypeField $field
AuthorizationChecker $authorizationChecker
bool $preview

Return Value

array|null

at line 948
array|null findByNodeAndFieldName(Node $node, $fieldName, AuthorizationChecker $authorizationChecker = null, bool $preview = false)

Parameters

Node $node
$fieldName
AuthorizationChecker $authorizationChecker
bool $preview

Return Value

array|null

at line 982
array|null findByNodeAndFieldAndTranslation(Node $node, NodeTypeField $field, Translation $translation, AuthorizationChecker $authorizationChecker = null, bool $preview = false)

Parameters

Node $node
NodeTypeField $field
Translation $translation
AuthorizationChecker $authorizationChecker
bool $preview

Return Value

array|null

at line 1006
array|null findByNodeAndFieldNameAndTranslation(Node $node, $fieldName, Translation $translation, AuthorizationChecker $authorizationChecker = null, bool $preview = false)

Parameters

Node $node
$fieldName
Translation $translation
AuthorizationChecker $authorizationChecker
bool $preview

Return Value

array|null

at line 1043
array findByReverseNodeAndField(Node $node, NodeTypeField $field, AuthorizationChecker $authorizationChecker = null, bool $preview = false)

Parameters

Node $node
NodeTypeField $field
AuthorizationChecker $authorizationChecker
bool $preview

Return Value

array

at line 1064
array findByReverseNodeAndFieldName(Node $node, string $fieldName, AuthorizationChecker $authorizationChecker = null, bool $preview = false)

Parameters

Node $node
string $fieldName
AuthorizationChecker $authorizationChecker
bool $preview

Return Value

array

at line 1098
array|null findByReverseNodeAndFieldAndTranslation(Node $node, NodeTypeField $field, Translation $translation, AuthorizationChecker $authorizationChecker = null, bool $preview = false)

Parameters

Node $node
NodeTypeField $field
Translation $translation
AuthorizationChecker $authorizationChecker
bool $preview

Return Value

array|null

at line 1122
array|null findByReverseNodeAndFieldNameAndTranslation(Node $node, $fieldName, Translation $translation, AuthorizationChecker $authorizationChecker = null, bool $preview = false)

Parameters

Node $node
$fieldName
Translation $translation
AuthorizationChecker $authorizationChecker
bool $preview

Return Value

array|null

at line 1156
array findAllOffspringIdByNode(Node $node)

Parameters

Node $node

Return Value

array

at line 1191
array|null findAllNodeParentsBy(Node $node, array $criteria, array $orderBy = null, integer $limit = null, integer $offset = null, Translation $translation = null, AuthorizationChecker $authorizationChecker = null, bool $preview = false)

Find all node’ parents with criteria and ordering.

Parameters

Node $node
array $criteria
array $orderBy
integer $limit
integer $offset
Translation $translation
AuthorizationChecker $authorizationChecker
bool $preview

Return Value

array|null

at line 1225
array findAllParentsIdByNode(Node $node)

Parameters

Node $node

Return Value

array

at line 1242
array findAvailableTranslationForNode(Node $node)

Parameters

Node $node

Return Value

array

at line 1263
array findUnavailableTranslationForNode(Node $node)

Parameters

Node $node

Return Value

array

at line 1282
array findAvailableTranslationIdForNode(Node $node)

Parameters

Node $node

Return Value

array

at line 1304
array findUnavailableTranslationIdForNode(Node $node)

Parameters

Node $node

Return Value

array