PHP Class Newscoop\NewscoopBundle\Entity\Repository\TopicRepository

Inheritance: extends Gedmo\Tree\Entity\Repository\NestedTreeRepository
Show file Open project: sourcefabric/newscoop

Public Properties

Property Type Description
$onChildrenQuery

Public Methods

Method Description
childrenQuery ( $node = null, $direct = false, $sortByField = null, $direction = 'ASC', $include = false ) Will do reordering based on current translations.
childrenWithTranslations ( $node = null, $locale = null, $direct = false, $sortByField = null, $direction = 'ASC', $includeNode = false, $start = null, $limit = null )
countBy ( array $criteria = [] ) : integer Count topics by given criteria.
findAllParentChoices ( Topic $node = null ) : array Get all parent choices.
findOptions ( ) : array Find topic options.
getArticleTopics ( integer $articleNr, string $languageCode, string $order = 'asc' ) : Doctrine\ORM\Query Get Topics for Article.
getArticlesQueryByTopicIdAndLanguage ( integer $topicId, string $languageCode, boolean $defaultFallback = false ) : Doctrine\ORM\Query Get all articles for given topic by topic id and language code.
getOneByExtractedFullName ( $name, $languageCode )
getReadablePath ( Topic $topic, $locale = null ) : string Gets topic's path.
getRootNodes ( $locale = null, $childrenLevel = false, $sortByField = null, $direction = 'asc' ) {@inheritDoc}
getSingleTopicQuery ( integer $id, string $locale = null ) : Doctrine\ORM\Query Gets the single topic's query by id.
getTopicByIdOrName ( string | integer $topicIdOrName, string | integer $locale = null ) : Doctrine\ORM\Query Gets topic by given id or name.
getTopics ( $languageCode = null ) : Doctrine\ORM\Query Get all topics.
getTopicsQuery ( $direction = 'ASC' )
getTranslatableTopicLocale ( Topic $topic )
getTranslatableTopics ( $locale, $order = 'asc' ) Get topics query and set translatable hints.
searchTopics ( string $query, array $sort = [], $limit = null, $locale = null ) : Doctrine\ORM\Query Search topic by given query.
setTranslatableHint ( Doctrine\ORM\Query $query, string | null $locale = null ) : Doctrine\ORM\Query Add hints to the query.

Method Details

childrenQuery() public method

Will do reordering based on current translations.
public childrenQuery ( $node = null, $direct = false, $sortByField = null, $direction = 'ASC', $include = false )

childrenWithTranslations() public method

See also: getChildrenQueryBuilder
public childrenWithTranslations ( $node = null, $locale = null, $direct = false, $sortByField = null, $direction = 'ASC', $includeNode = false, $start = null, $limit = null )

countBy() public method

Count topics by given criteria.
public countBy ( array $criteria = [] ) : integer
$criteria array
return integer

findAllParentChoices() public method

Get all parent choices.
public findAllParentChoices ( Topic $node = null ) : array
$node Newscoop\NewscoopBundle\Entity\Topic Topic object
return array

findOptions() public method

Find topic options.
public findOptions ( ) : array
return array

getArticleTopics() public method

Returns all the associated Topics to an Article.
public getArticleTopics ( integer $articleNr, string $languageCode, string $order = 'asc' ) : Doctrine\ORM\Query
$articleNr integer Article number
$languageCode string Language code in format "en" for example.
$order string Order of the topics, default ascending
return Doctrine\ORM\Query Query

getArticlesQueryByTopicIdAndLanguage() public method

Get all articles for given topic by topic id and language code.
public getArticlesQueryByTopicIdAndLanguage ( integer $topicId, string $languageCode, boolean $defaultFallback = false ) : Doctrine\ORM\Query
$topicId integer Topic id
$languageCode string Language code
$defaultFallback boolean Sets the language of the topic to the default one
return Doctrine\ORM\Query

getOneByExtractedFullName() public method

public getOneByExtractedFullName ( $name, $languageCode )

getReadablePath() public method

Gets topic's path.
public getReadablePath ( Topic $topic, $locale = null ) : string
$topic Newscoop\NewscoopBundle\Entity\Topic Topic
return string Path of the topic

getRootNodes() public method

{@inheritDoc}
public getRootNodes ( $locale = null, $childrenLevel = false, $sortByField = null, $direction = 'asc' )

getSingleTopicQuery() public method

Gets the single topic's query by id.
public getSingleTopicQuery ( integer $id, string $locale = null ) : Doctrine\ORM\Query
$id integer Topic id
$locale string Language code
return Doctrine\ORM\Query $query Query object

getTopicByIdOrName() public method

Gets topic by given id or name.
public getTopicByIdOrName ( string | integer $topicIdOrName, string | integer $locale = null ) : Doctrine\ORM\Query
$topicIdOrName string | integer Topicid or name
$locale string | integer Current locale, language code or id
return Doctrine\ORM\Query

getTopics() public method

Get all topics.
public getTopics ( $languageCode = null ) : Doctrine\ORM\Query
$languageCode Language code
return Doctrine\ORM\Query

getTopicsQuery() public method

public getTopicsQuery ( $direction = 'ASC' )

getTranslatableTopicLocale() public method

public getTranslatableTopicLocale ( Topic $topic )
$topic Newscoop\NewscoopBundle\Entity\Topic

getTranslatableTopics() public method

Get topics query and set translatable hints.
public getTranslatableTopics ( $locale, $order = 'asc' )

searchTopics() public method

Search topic by given query.
public searchTopics ( string $query, array $sort = [], $limit = null, $locale = null ) : Doctrine\ORM\Query
$query string
$sort array
return Doctrine\ORM\Query

setTranslatableHint() public method

Add hints to the query.
public setTranslatableHint ( Doctrine\ORM\Query $query, string | null $locale = null ) : Doctrine\ORM\Query
$query Doctrine\ORM\Query Query
$locale string | null Lecale to which fallback
return Doctrine\ORM\Query

Property Details

$onChildrenQuery public property

public $onChildrenQuery