PHP Class Newscoop\Services\CommentService

Afficher le fichier Open project: sourcefabric/newscoop

Protected Properties

Свойство Type Description
$em Doctrine\ORM\EntityManager

Méthodes publiques

Méthode Description
__construct ( EntityManager $em, PublicationService $publicationService )
countBy ( array $criteria ) : integer Get total count for given criteria
find ( integer $id ) : Newscoop\Entity\Comment Find a comment by its id.
findBy ( array $criteria, array | null $orderBy = null, integer | null $limit = null, integer | null $offset = null ) : array Find records by set of criteria
findUserComments ( array $params, array $order, integer $limit, integer $start ) : array Gets all replies to a comment.
getAllReplies ( integer | array $commentId, Newscoop\Repository\CommentRepository $commentRepository ) : array Gets all replies to a comment.
getArticleStats ( mixed $ids ) : array Get comments statistics for articles
getCommentCounts ( array $ids, $recommended = false, $all = false ) : array Get articles comment counts
getRepository ( ) : Newscoop\Entity\Repository\CommentRepository Get repository for comment entity
isBanned ( Newscoop\Entity\Comment\Commenter $commenter ) : boolean Checks if a commenter is banned
remove ( Comment $comment ) : Comment Mark comment as removed
save ( Comment $comment, array $attributes, $userId = null ) : Comment Save (create new/update) comment (with commenter)
searchByPhrase ( string $phrase ) : Doctrine\ORM\QueryBuilder Searchs comments by given phrase
update ( GenericEvent $event ) : void Receives notifications of points events.
updateComment ( Comment $comment, array $attributes ) : Comment Update comment

Private Methods

Méthode Description
comment_create ( $params )
comment_delete ( $params )
comment_recommended ( $params )
comment_update ( $params )
getCommentsEnabled ( array $ids ) Get article comments_enabled

Method Details

__construct() public méthode

public __construct ( EntityManager $em, PublicationService $publicationService )
$em Doctrine\ORM\EntityManager
$publicationService PublicationService

countBy() public méthode

Get total count for given criteria
public countBy ( array $criteria ) : integer
$criteria array
Résultat integer

find() public méthode

Find a comment by its id.
public find ( integer $id ) : Newscoop\Entity\Comment
$id integer
Résultat Newscoop\Entity\Comment

findBy() public méthode

Find records by set of criteria
public findBy ( array $criteria, array | null $orderBy = null, integer | null $limit = null, integer | null $offset = null ) : array
$criteria array
$orderBy array | null
$limit integer | null
$offset integer | null
Résultat array

findUserComments() public méthode

Gets all replies to a comment.
public findUserComments ( array $params, array $order, integer $limit, integer $start ) : array
$params array Parameters
$order array Order
$limit integer Result limit
$start integer Result start
Résultat array

getAllReplies() public méthode

Gets all replies to a comment.
public getAllReplies ( integer | array $commentId, Newscoop\Repository\CommentRepository $commentRepository ) : array
$commentId integer | array Comment id
$commentRepository Newscoop\Repository\CommentRepository Comment repository
Résultat array

getArticleStats() public méthode

Get comments statistics for articles
public getArticleStats ( mixed $ids ) : array
$ids mixed
Résultat array

getCommentCounts() public méthode

Get articles comment counts
public getCommentCounts ( array $ids, $recommended = false, $all = false ) : array
$ids array
Résultat array

getRepository() public méthode

Get repository for comment entity
public getRepository ( ) : Newscoop\Entity\Repository\CommentRepository
Résultat Newscoop\Entity\Repository\CommentRepository

isBanned() public méthode

Checks if a commenter is banned
public isBanned ( Newscoop\Entity\Comment\Commenter $commenter ) : boolean
$commenter Newscoop\Entity\Comment\Commenter Commenter
Résultat boolean

remove() public méthode

Mark comment as removed
public remove ( Comment $comment ) : Comment
$comment Newscoop\Entity\Comment
Résultat Newscoop\Entity\Comment

save() public méthode

Save (create new/update) comment (with commenter)
public save ( Comment $comment, array $attributes, $userId = null ) : Comment
$comment Newscoop\Entity\Comment
$attributes array
Résultat Newscoop\Entity\Comment

searchByPhrase() public méthode

Searchs comments by given phrase
public searchByPhrase ( string $phrase ) : Doctrine\ORM\QueryBuilder
$phrase string Phrase
Résultat Doctrine\ORM\QueryBuilder

update() public méthode

Receives notifications of points events.
public update ( GenericEvent $event ) : void
$event Newscoop\EventDispatcher\Events\GenericEvent
Résultat void

updateComment() public méthode

Update comment
public updateComment ( Comment $comment, array $attributes ) : Comment
$comment Newscoop\Entity\Comment
$attributes array
Résultat Newscoop\Entity\Comment

Property Details

$em protected_oe property

protected EntityManager,Doctrine\ORM $em
Résultat Doctrine\ORM\EntityManager