PHP Класс Newscoop\Entity\Repository\CommentRepository

Наследование: extends Newscoop\Datatable\Source, implements Newscoop\Search\RepositoryInterface
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
countByUser ( User $user ) : integer Get comments count for user
deleteArticle ( Newscoop\Entity\Article $article, Newscoop\Entity\Language $language = null ) Delete article comments
deleteCommenter ( Newscoop\Entity\Commenter $commenter ) Delete commenter comments
deleteCommenters ( array $commenters ) Delete commenter comments
flush ( ) Flush method
getArticleComments ( integer $article, string $language, $recommended = false, $getDeleted = true, $showHidden = true ) : Doctrine\ORM\Query Get comments for article
getBatch ( mixed $count = self::BATCH_COUNT, array $filter = null ) : array Find comments for indexing
getComment ( integer $id, $getDeleted = true ) : Query Get single comment query
getComments ( $getDeleted = true, $showHidden = true ) : Query Get all comments query
getCommentsForAuthorArticlesPerDay ( Author $author, string $range = '-60 days' ) : Doctrine\ORM\Query Get Comments for all authors articles grouped by day
getCount ( array $p_params = null, array $p_cols = [] ) : integer Get entity count
getData ( array $p_params, array $p_cols ) : Comment[] Get data for table
getDirectReplies ( $commentId ) Get direct replies to a comment
getPrototype ( ) : Comment Get new instance of the comment
save ( Comment $entity, array $values ) : Comment Method for saving a comment
setArticleStatus ( integer $p_article, $p_language, string $p_status ) : void Method for setting status per article
setCommentRecommended ( Comment $comment, string $recommended ) : void Method for setting recommended for a comment
setIndexedNow ( array $comments ) : void Set indexed now
setIndexedNull ( array $comments = null ) : void Set indexed null
setRecommended ( array $commentIds, integer $recommended ) : void Method for recommending a comment
setStatus ( array $p_comment_ids, string $p_status ) : void Method for setting status
update ( Comment $comment, array $values ) : Comment Method for update a comment

Защищенные методы

Метод Описание
buildFilter ( array $p_cols, array $p_filter, $qb, $andx ) Build filter condition
buildWhere ( array $p_cols, $p_search, $qb = null, $andx = null ) : Doctrine\ORM\Query\Expr Build where condition

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

Метод Описание
setCommentStatus ( Comment $p_comment, string $p_status ) : void Method for setting status for a comment

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

buildFilter() защищенный Метод

Build filter condition
protected buildFilter ( array $p_cols, array $p_filter, $qb, $andx )
$p_cols array
$p_filter array

buildWhere() защищенный Метод

Build where condition
protected buildWhere ( array $p_cols, $p_search, $qb = null, $andx = null ) : Doctrine\ORM\Query\Expr
$p_cols array
Результат Doctrine\ORM\Query\Expr

countByUser() публичный Метод

Get comments count for user
public countByUser ( User $user ) : integer
$user Newscoop\Entity\User
Результат integer

deleteArticle() публичный Метод

Delete article comments
public deleteArticle ( Newscoop\Entity\Article $article, Newscoop\Entity\Language $language = null )
$article Newscoop\Entity\Article
$language Newscoop\Entity\Language

deleteCommenter() публичный Метод

Delete commenter comments
public deleteCommenter ( Newscoop\Entity\Commenter $commenter )
$commenter Newscoop\Entity\Commenter

deleteCommenters() публичный Метод

Delete commenter comments
public deleteCommenters ( array $commenters )
$commenters array

flush() публичный Метод

Flush method
public flush ( )

getArticleComments() публичный Метод

Get comments for article
public getArticleComments ( integer $article, string $language, $recommended = false, $getDeleted = true, $showHidden = true ) : Doctrine\ORM\Query
$article integer Article number
$language string Language code in format "en" for example.
Результат Doctrine\ORM\Query Query

getBatch() публичный Метод

Find comments for indexing
public getBatch ( mixed $count = self::BATCH_COUNT, array $filter = null ) : array
$count mixed Number of comments to index. When null default will be used
$filter array
Результат array

getComment() публичный Метод

Get single comment query
public getComment ( integer $id, $getDeleted = true ) : Query
$id integer
Результат Query

getComments() публичный Метод

Get all comments query
public getComments ( $getDeleted = true, $showHidden = true ) : Query
Результат Query

getCommentsForAuthorArticlesPerDay() публичный Метод

Get Comments for all authors articles grouped by day
public getCommentsForAuthorArticlesPerDay ( Author $author, string $range = '-60 days' ) : Doctrine\ORM\Query
$author Newscoop\Entity\Author
$range string
Результат Doctrine\ORM\Query

getCount() публичный Метод

Get entity count
public getCount ( array $p_params = null, array $p_cols = [] ) : integer
$p_params array
$p_cols array
Результат integer

getData() публичный Метод

Get data for table
public getData ( array $p_params, array $p_cols ) : Comment[]
$p_params array
$p_cols array
Результат Newscoop\Entity\Comment[]

getDirectReplies() публичный Метод

Get direct replies to a comment
public getDirectReplies ( $commentId )
$commentId return array

getPrototype() публичный Метод

Get new instance of the comment
public getPrototype ( ) : Comment
Результат Newscoop\Entity\Comment

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

Method for saving a comment
public save ( Comment $entity, array $values ) : Comment
$entity Newscoop\Entity\Comment
$values array
Результат Newscoop\Entity\Comment

setArticleStatus() публичный Метод

Method for setting status per article
public setArticleStatus ( integer $p_article, $p_language, string $p_status ) : void
$p_article integer
$p_status string
Результат void

setCommentRecommended() публичный Метод

Method for setting recommended for a comment
public setCommentRecommended ( Comment $comment, string $recommended ) : void
$comment Newscoop\Entity\Comment
$recommended string
Результат void

setIndexedNow() публичный Метод

Set indexed now
public setIndexedNow ( array $comments ) : void
$comments array
Результат void

setIndexedNull() публичный Метод

Set indexed null
public setIndexedNull ( array $comments = null ) : void
$comments array
Результат void

setRecommended() публичный Метод

Method for recommending a comment
public setRecommended ( array $commentIds, integer $recommended ) : void
$commentIds array
$recommended integer
Результат void

setStatus() публичный Метод

Method for setting status
public setStatus ( array $p_comment_ids, string $p_status ) : void
$p_comment_ids array
$p_status string
Результат void

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

Method for update a comment
public update ( Comment $comment, array $values ) : Comment
$comment Newscoop\Entity\Comment
$values array
Результат Newscoop\Entity\Comment $enitity