PHP Class Newscoop\Services\AuthorService

Show file Open project: sourcefabric/newscoop

Protected Properties

Property Type Description
$em Doctrine\ORM\EntityManager
$repository Doctrine\ORM\EntityRepository

Public Methods

Method Description
__construct ( EntityManager $em )
addAuthorToArticle ( Article $article, Author $author, AuthorType $authorType ) : ArticleAuthor Add author with type to article
getAuthors ( string $term = null, integer $limit = null, boolean $alsoUsers = false ) : array Get authors
getOptions ( ) : array Get author options
removeAuthorFromArticle ( Article $article, Author $author, AuthorType $authorType ) : ArticleAuthor Remove author with type from article
reorderAuthors ( EntityManager $em, array $articleAuthors, array $order = [] ) : boolean Reorder Article Authors

Method Details

__construct() public method

public __construct ( EntityManager $em )
$em Doctrine\ORM\EntityManager

addAuthorToArticle() public method

Add author with type to article
public addAuthorToArticle ( Article $article, Author $author, AuthorType $authorType ) : ArticleAuthor
$article Newscoop\Entity\Article
$author Newscoop\Entity\Author
$authorType Newscoop\Entity\AuthorType
return Newscoop\Entity\ArticleAuthor

getAuthors() public method

Get authors
public getAuthors ( string $term = null, integer $limit = null, boolean $alsoUsers = false ) : array
$term string Search term
$limit integer Max results
$alsoUsers boolean Also return users
return array

getOptions() public method

Get author options
public getOptions ( ) : array
return array

removeAuthorFromArticle() public method

Remove author with type from article
public removeAuthorFromArticle ( Article $article, Author $author, AuthorType $authorType ) : ArticleAuthor
$article Newscoop\Entity\Article
$author Newscoop\Entity\Author
$authorType Newscoop\Entity\AuthorType
return Newscoop\Entity\ArticleAuthor

reorderAuthors() public method

Reorder Article Authors
public reorderAuthors ( EntityManager $em, array $articleAuthors, array $order = [] ) : boolean
$em Doctrine\ORM\EntityManager
$articleAuthors array
$order array
return boolean

Property Details

$em protected property

protected EntityManager,Doctrine\ORM $em
return Doctrine\ORM\EntityManager

$repository protected property

protected Doctrine\ORM\EntityRepository $repository
return Doctrine\ORM\EntityRepository