PHP Class Newscoop\Entity\Repository\SnippetRepository

Inheritance: extends Doctrine\ORM\EntityRepository
Afficher le fichier Open project: sourcefabric/newscoop

Méthodes publiques

Méthode Description
addSnippetToArticle ( Snippet $snippet, Article $article )
deleteSnippet ( $id, $force = false )
findSnippetsByName ( string $name, string $show = 'enabled', boolean $fuzzy = false ) : Doctrine\ORM\Query Get Snippet by Name
findSnippetsByNameForArticle ( $articleNr, $languageCode, string $name, string $show = 'enabled', boolean $fuzzy = false ) : Doctrine\ORM\Query Get Snippet by Name
getArticleSnippets ( $articleNr, $languageCode, string $show = 'enabled' ) : Doctrine\ORM\Query Get Snippets for Article
getSnippetById ( integer $id, string $show = 'enabled', $template = true ) : Snippet Get Snippet
getSnippets ( string $show = 'enabled' ) : Doctrine\ORM\Query Get all Snippets
removeSnippetFromArticle ( Snippet $snippet, Article $article )
save ( Snippet $snippet )

Méthodes protégées

Méthode Description
checkIfSnippetIsDisabled ( Doctrine\ORM\QueryBuilder $queryBuilder, mixed $result, string $show ) Check if a Snippet is disabled Internal use only
getArticleSnippetQueryBuilder ( $articleNr, string $language, string $show ) : Doctrine\ORM\Querybuilder Convenience QueryBuilder for Snippets attached to an Article
getSnippetArticles ( integer $id ) : Doctrine\Common\Collections\ArrayCollection Get all the Articles attached to a Snippet
getSnippetQueryBuilder ( string $show, $templateEnabled = true ) : Doctrine\ORM\Querybuilder Convenience QueryBuilder for Snippets

Method Details

addSnippetToArticle() public méthode

public addSnippetToArticle ( Snippet $snippet, Article $article )
$snippet Newscoop\Entity\Snippet
$article Newscoop\Entity\Article

checkIfSnippetIsDisabled() protected méthode

Check if a Snippet is disabled Internal use only
protected checkIfSnippetIsDisabled ( Doctrine\ORM\QueryBuilder $queryBuilder, mixed $result, string $show )
$queryBuilder Doctrine\ORM\QueryBuilder
$result mixed
$show string

deleteSnippet() public méthode

public deleteSnippet ( $id, $force = false )

findSnippetsByName() public méthode

Get Snippet by Name
public findSnippetsByName ( string $name, string $show = 'enabled', boolean $fuzzy = false ) : Doctrine\ORM\Query
$name string Snippet Name
$show string Define which Snippets to return, 'enabled' | 'disabled' | 'all'
$fuzzy boolean Find fuzzy or not
Résultat Doctrine\ORM\Query Query

findSnippetsByNameForArticle() public méthode

Get Snippet by Name
public findSnippetsByNameForArticle ( $articleNr, $languageCode, string $name, string $show = 'enabled', boolean $fuzzy = false ) : Doctrine\ORM\Query
$name string Snippet Name
$show string Define which Snippets to return, 'enabled' | 'disabled' | 'all'
$fuzzy boolean Find fuzzy or not
Résultat Doctrine\ORM\Query Query

getArticleSnippetQueryBuilder() protected méthode

This internal function is used by almost all Repository functions, it allows for more consistency. The rest of the doc also applies to the functions using it. Returns all the associated Snippets to an Article. If the SnippetTemplate is disabled, the Snippets depending on it won't be returned. By Default all Snippets that are Disabled themselves are not returned.
protected getArticleSnippetQueryBuilder ( $articleNr, string $language, string $show ) : Doctrine\ORM\Querybuilder
$language string Language code in format "en" for example.
$show string Define which Snippets to return, 'enabled' | 'disabled' | 'all'
Résultat Doctrine\ORM\Querybuilder $queryBuilder

getArticleSnippets() public méthode

Returns all the associated Snippets to an Article. If the SnippetTemplate is disabled, the Snippets depending on it won't be returned. By Default all Snippets that are Disabled themselves are not returned.
public getArticleSnippets ( $articleNr, $languageCode, string $show = 'enabled' ) : Doctrine\ORM\Query
$show string Define which Snippets to return, 'enabled' | 'disabled' | 'all'
Résultat Doctrine\ORM\Query Query

getSnippetArticles() protected méthode

Get all the Articles attached to a Snippet
protected getSnippetArticles ( integer $id ) : Doctrine\Common\Collections\ArrayCollection
$id integer SnippetID
Résultat Doctrine\Common\Collections\ArrayCollection

getSnippetById() public méthode

Get Snippet
public getSnippetById ( integer $id, string $show = 'enabled', $template = true ) : Snippet
$id integer Snippet ID
$show string Define which Snippets to return, 'enabled' | 'disabled' | 'all'
Résultat Newscoop\Entity\Snippet

getSnippetQueryBuilder() protected méthode

This internal function is used by almost all Repository functions, it allows for more consistency. The rest of the doc also applies to the functions using it. Returns all Snippets. If the SnippetTemplate is disabled, the Snippets depending on it won't be returned. By Default all Snippets that are Disabled themselves are not returned.
protected getSnippetQueryBuilder ( string $show, $templateEnabled = true ) : Doctrine\ORM\Querybuilder
$show string Define which Snippets to return, 'enabled' | 'disabled' | 'all'
Résultat Doctrine\ORM\Querybuilder $queryBuilder

getSnippets() public méthode

Returns all Snippets. If the SnippetTemplate is disabled, the Snippets depending on it won't be returned. By Default all Snippets that are Disabled themselves are not returned.
public getSnippets ( string $show = 'enabled' ) : Doctrine\ORM\Query
$show string Define which Snippets to return, 'enabled' | 'disabled' | 'all'
Résultat Doctrine\ORM\Query Query

removeSnippetFromArticle() public méthode

public removeSnippetFromArticle ( Snippet $snippet, Article $article )
$snippet Newscoop\Entity\Snippet
$article Newscoop\Entity\Article

save() public méthode

public save ( Snippet $snippet )
$snippet Newscoop\Entity\Snippet