PHP 클래스 Newscoop\Services\CommentService

파일 보기 프로젝트 열기: sourcefabric/newscoop

보호된 프로퍼티들

프로퍼티 타입 설명
$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