PHP Class Newscoop\Services\BlogService

ファイルを表示 Open project: sourcefabric/newscoop

Protected Properties

Property Type Description
$config array
$em
$getArticleActions array
$postArticleActions array

Public Methods

Method Description
__construct ( array $config, EntityManager $em )
createBlog ( string $title, Section $section ) : Article Create blog article
getBlogInfo ( User $user ) : Article | null Get blog info article
getSection ( User $user ) : Section | null Get blog section for given user
isAllowed ( Zend_Controller_Request_Abstract $request, User $user = null ) : boolean Test if blogger is allowed to perform action
isBlogAuthor ( Author $author, Article $blogInfo ) : boolean Test if author is blog author
isBlogger ( User $user ) : boolean Test if user is blogger
isUsersArticle ( Article $article, User $user ) : boolean Test if given article is from users blog

Private Methods

Method Description
isRequestedArticleEditable ( Zend_Controller_Request_Abstract $request, User $user ) : boolean Test if requested article is editable by user

Method Details

__construct() public method

public __construct ( array $config, EntityManager $em )
$config array
$em Doctrine\ORM\EntityManager

createBlog() public method

Create blog article
public createBlog ( string $title, Section $section ) : Article
$title string
$section Section
return Article

getBlogInfo() public method

Get blog info article
public getBlogInfo ( User $user ) : Article | null
$user Newscoop\Entity\User
return Article | null

getSection() public method

Get blog section for given user
public getSection ( User $user ) : Section | null
$user Newscoop\Entity\User
return Section | null

isAllowed() public method

Test if blogger is allowed to perform action
public isAllowed ( Zend_Controller_Request_Abstract $request, User $user = null ) : boolean
$request Zend_Controller_Request_Abstract
$user Newscoop\Entity\User
return boolean

isBlogAuthor() public method

Test if author is blog author
public isBlogAuthor ( Author $author, Article $blogInfo ) : boolean
$author Author
$blogInfo Article
return boolean

isBlogger() public method

Test if user is blogger
public isBlogger ( User $user ) : boolean
$user Newscoop\Entity\User
return boolean

isUsersArticle() public method

Test if given article is from users blog
public isUsersArticle ( Article $article, User $user ) : boolean
$article Article
$user Newscoop\Entity\User
return boolean

Property Details

$config protected_oe property

protected array $config
return array

$em protected_oe property

protected $em

$getArticleActions protected_oe property

protected array $getArticleActions
return array

$postArticleActions protected_oe property

protected array $postArticleActions
return array