class CommentRepository extends EntityRepository

Class CommentRepository is injected as alligator.comment_repository service. CommentRepository is used for crud operation for entity.

Use this class to work with database.

Constants

ALIAS

USER_ALIAS

TICKET_ALIAS

Methods

getDBComment(Comment $comment)

Find comment(as object) by id

getAllComments()

Find all comments

saveCommentRepository(Comment $entity)

Save new comment

bool
changeCommentStatuses(array $arrayOfComments, int $ticketId)

Change status of all provided comments to "seen"

deleteOneCommentObject(Comment $comment)

Remove comment by id

array
findAllCommentsById(int $id)

Find all comments for provided ticket id

array
getAllCommentsLimited(mixed $limit)

Find provided($limit) number of comments(as array)

Details

at line 33
Comment getDBComment(Comment $comment)

Find comment(as object) by id

Parameters

Comment $comment

Return Value

Comment

at line 43
Comment[] getAllComments()

Find all comments

Return Value

Comment[]

at line 55
Comment saveCommentRepository(Comment $entity)

Save new comment

Parameters

Comment $entity

Return Value

Comment

at line 79
bool changeCommentStatuses(array $arrayOfComments, int $ticketId)

Change status of all provided comments to "seen"

Parameters

array $arrayOfComments
int $ticketId

Return Value

bool

Exceptions

ORMException
OptimisticLockException

at line 102
Comment deleteOneCommentObject(Comment $comment)

Remove comment by id

Parameters

Comment $comment

Return Value

Comment

Exceptions

ORMException
OptimisticLockException

at line 120
array findAllCommentsById(int $id)

Find all comments for provided ticket id

Parameters

int $id Ticket id

Return Value

array

at line 146
array getAllCommentsLimited(mixed $limit)

Find provided($limit) number of comments(as array)

Parameters

mixed $limit

Return Value

array