PHP Класс Newscoop\Services\CommentService

Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$em Doctrine\ORM\EntityManager

Открытые методы

Метод Описание
__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

Приватные методы

Метод Описание
comment_create ( $params )
comment_delete ( $params )
comment_recommended ( $params )
comment_update ( $params )
getCommentsEnabled ( array $ids ) Get article comments_enabled

Описание методов

__construct() публичный метод

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

countBy() публичный метод

Get total count for given criteria
public countBy ( array $criteria ) : integer
$criteria array
Результат integer

find() публичный метод

Find a comment by its id.
public find ( integer $id ) : Newscoop\Entity\Comment
$id integer
Результат Newscoop\Entity\Comment

findBy() публичный метод

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
Результат array

findUserComments() публичный метод

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
Результат array

getAllReplies() публичный метод

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
Результат array

getArticleStats() публичный метод

Get comments statistics for articles
public getArticleStats ( mixed $ids ) : array
$ids mixed
Результат array

getCommentCounts() публичный метод

Get articles comment counts
public getCommentCounts ( array $ids, $recommended = false, $all = false ) : array
$ids array
Результат array

getRepository() публичный метод

Get repository for comment entity
public getRepository ( ) : Newscoop\Entity\Repository\CommentRepository
Результат Newscoop\Entity\Repository\CommentRepository

isBanned() публичный метод

Checks if a commenter is banned
public isBanned ( Newscoop\Entity\Comment\Commenter $commenter ) : boolean
$commenter Newscoop\Entity\Comment\Commenter Commenter
Результат boolean

remove() публичный метод

Mark comment as removed
public remove ( Comment $comment ) : Comment
$comment Newscoop\Entity\Comment
Результат Newscoop\Entity\Comment

save() публичный метод

Save (create new/update) comment (with commenter)
public save ( Comment $comment, array $attributes, $userId = null ) : Comment
$comment Newscoop\Entity\Comment
$attributes array
Результат Newscoop\Entity\Comment

searchByPhrase() публичный метод

Searchs comments by given phrase
public searchByPhrase ( string $phrase ) : Doctrine\ORM\QueryBuilder
$phrase string Phrase
Результат Doctrine\ORM\QueryBuilder

update() публичный метод

Receives notifications of points events.
public update ( GenericEvent $event ) : void
$event Newscoop\EventDispatcher\Events\GenericEvent
Результат void

updateComment() публичный метод

Update comment
public updateComment ( Comment $comment, array $attributes ) : Comment
$comment Newscoop\Entity\Comment
$attributes array
Результат Newscoop\Entity\Comment

Описание свойств

$em защищенное свойство

protected EntityManager,Doctrine\ORM $em
Результат Doctrine\ORM\EntityManager