Beta version

class NodesSourcesRepository extends EntityRepository

EntityRepository that implements search engine query with Solr.

Methods

int
countBy(array $criteria, 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|Paginator
findBy(array $criteria, array $orderBy = null, integer $limit = null, integer $offset = null, AuthorizationChecker $authorizationChecker = null, boolean $preview = false)

A secure findBy with which user must be a backend user to see unpublished nodes.

findOneBy(array $criteria, array $orderBy = null, AuthorizationChecker $authorizationChecker = null, boolean $preview = false)

A secure findOneBy with which user must be a backend user to see unpublished nodes.

array
findBySearchQuery(string $query, integer $limit = 25)

Search nodes sources by using Solr search engine.

array
findBySearchQueryAndTranslation(string $query, Translation $translation, int $limit = 25)

Search nodes sources by using Solr search engine and a specific translation.

array
findByTextQuery($textQuery, int $limit, array $nodeTypes = array(), bool $onlyVisible = false, AuthorizationChecker $authorizationChecker = null, bool $preview = false)

Search Nodes-Sources using LIKE condition on title meta-title, meta-keywords, meta-description.

Paginator
findByLatestUpdated(integer $maxResult = 5)

Find latest updated NodesSources using Log table.

findParent(NodesSources $nodeSource)

Get node-source parent according to its translation.

mixed|null
findOneByNodeAndTranslation(Node $node, Translation $translation)

No description

Details

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

Just like the countBy method but with relational criteria.

Parameters

array $criteria or array
AuthorizationChecker $authorizationChecker
boolean $preview

Return Value

int

in EntityRepository at line 440
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 487
int countSearchBy(string $pattern, array $criteria = array())

Parameters

string $pattern Search pattern
array $criteria Additionnal criteria

Return Value

int

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

A secure findBy with which user must be a backend user to see unpublished nodes.

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 even can filter with node fields, examples:

  • node.published => true
  • node.nodeName => 'page1'

Or filter by tags:

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

Parameters

array $criteria
array $orderBy
integer $limit
integer $offset
AuthorizationChecker $authorizationChecker
boolean $preview

Return Value

array|Paginator

at line 437
NodesSources|null findOneBy(array $criteria, array $orderBy = null, AuthorizationChecker $authorizationChecker = null, boolean $preview = false)

A secure findOneBy with which user must be a backend user to see unpublished nodes.

Parameters

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

Return Value

NodesSources|null

at line 472
array findBySearchQuery(string $query, integer $limit = 25)

Search nodes sources by using Solr search engine.

Parameters

string $query Solr query string (for example: text:Lorem Ipsum)
integer $limit Result number to fetch (default: all)

Return Value

array

at line 497
array findBySearchQueryAndTranslation(string $query, Translation $translation, int $limit = 25)

Search nodes sources by using Solr search engine and a specific translation.

Parameters

string $query Solr query string (for example: text:Lorem Ipsum)
Translation $translation Current translation
int $limit

Return Value

array

at line 527
array findByTextQuery($textQuery, int $limit, array $nodeTypes = array(), bool $onlyVisible = false, AuthorizationChecker $authorizationChecker = null, bool $preview = false)

Search Nodes-Sources using LIKE condition on title meta-title, meta-keywords, meta-description.

Parameters

$textQuery
int $limit
array $nodeTypes
bool $onlyVisible
AuthorizationChecker $authorizationChecker
bool $preview

Return Value

array

at line 581
Paginator findByLatestUpdated(integer $maxResult = 5)

Find latest updated NodesSources using Log table.

Parameters

integer $maxResult

Return Value

Paginator

at line 603
NodesSources|null findParent(NodesSources $nodeSource)

Get node-source parent according to its translation.

Parameters

NodesSources $nodeSource

Return Value

NodesSources|null

at line 628
mixed|null findOneByNodeAndTranslation(Node $node, Translation $translation)

Parameters

Node $node
Translation $translation

Return Value

mixed|null

Exceptions

NonUniqueResultException