class ReviewRepository extends EntityRepository

Class ReviewRepository is injected as alligator.review_repository service. ReviewRepository is used for crud operation for entity.

Use this class to work with database.

Traits

Trait JQGridTrait

Constants

ALIAS

Alias for entity

AUTHOR_ALIAS

Alias for user entity

IMAGE_ALIAS

Alias for image entity

REVIEW_OFFSET

Indicates how much comments should be fetched when queried from frontend

Methods

jQGridJoinFields(QueryBuilder $qb, JQGridWrapper $jqGridWrapper)

All joins used in select.

jQGridGroupByFields(QueryBuilder $qb, JQGridWrapper $jqGridWrapper)

Should contain group by which jqgrid uses.

array
findAllForJQGRID(int $page, int $offset, array $sortParams, array $additionalParams, JQGridWrapper $jqGridWrapper)

JQGrid function

array
searchForJQGRID(array $searchParams, array $sortParams, bool $isCountSearch = false, array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

JQGrid function

Review|object
getDBReview(Review $review)

Find review that match provided id

array
getReviewWithSelectById(int $reviewId)

Find id, review content and approved status for review that match provided id

saveReviewRepository(Review $entity)

Persist new review

bool
deleteReviews(array $arrayOfReviews)

Remove reviews from provided array of reviews

array
findReviewsByProductSlug(string $lug, integer $page, boolean $isCountSearch = false)

Find all reviews for product that match provided slug

array
searchReviewsForProductEditBackend(int $productId, int $page, int|null $userId = null, DateTime $dateFrom = null, DateTime $dateTo = null)

Find all reviews that match provided criteria

edit(Review $review)

Update existing review

array
getReviewsForDashboard(int $number, bool $approved)

Find provided number of reviews

array
getReviewsObjectFromArray(array $array)

Find all reviews that match provided ids

array
getLatestApprovedReview(int $productId, int $userId)

Find latest approved reviews for provided product and user

Details

in JQGridTrait at line 27
jQGridJoinFields(QueryBuilder $qb, JQGridWrapper $jqGridWrapper)

All joins used in select.

Override in the repository class if needed. Should do nothing otherwise

Parameters

QueryBuilder $qb
JQGridWrapper $jqGridWrapper

in JQGridTrait at line 42
jQGridGroupByFields(QueryBuilder $qb, JQGridWrapper $jqGridWrapper)

Should contain group by which jqgrid uses.

Override in the repository class if needed. Should do nothing otherwise

Parameters

QueryBuilder $qb
JQGridWrapper $jqGridWrapper

in JQGridTrait at line 61
array findAllForJQGRID(int $page, int $offset, array $sortParams, array $additionalParams, JQGridWrapper $jqGridWrapper)

JQGrid function

Parameters

int $page
int $offset
array $sortParams
array $additionalParams
JQGridWrapper $jqGridWrapper

Return Value

array

in JQGridTrait at line 94
array searchForJQGRID(array $searchParams, array $sortParams, bool $isCountSearch = false, array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

JQGrid function

Parameters

array $searchParams
array $sortParams
bool $isCountSearch
array $additionalParams
JQGridWrapper $jqGridWrapper

Return Value

array

at line 60
Review|object getDBReview(Review $review)

Find review that match provided id

Parameters

Review $review

Return Value

Review|object

at line 72
array getReviewWithSelectById(int $reviewId)

Find id, review content and approved status for review that match provided id

Parameters

int $reviewId

Return Value

array

at line 89
Review saveReviewRepository(Review $entity)

Persist new review

Parameters

Review $entity

Return Value

Review

at line 110
bool deleteReviews(array $arrayOfReviews)

Remove reviews from provided array of reviews

Parameters

array $arrayOfReviews

Return Value

bool

Exceptions

Exception

at line 136
array findReviewsByProductSlug(string $lug, integer $page, boolean $isCountSearch = false)

Find all reviews for product that match provided slug

Parameters

string $lug
integer $page
boolean $isCountSearch

Return Value

array

at line 184
array searchReviewsForProductEditBackend(int $productId, int $page, int|null $userId = null, DateTime $dateFrom = null, DateTime $dateTo = null)

Find all reviews that match provided criteria

Parameters

int $productId
int $page
int|null $userId
DateTime $dateFrom
DateTime $dateTo

Return Value

array

at line 235
Review edit(Review $review)

Update existing review

Parameters

Review $review

Return Value

Review

at line 255
array getReviewsForDashboard(int $number, bool $approved)

Find provided number of reviews

Parameters

int $number
bool $approved

Return Value

array

at line 292
array getReviewsObjectFromArray(array $array)

Find all reviews that match provided ids

Parameters

array $array

Return Value

array

at line 309
array getLatestApprovedReview(int $productId, int $userId)

Find latest approved reviews for provided product and user

Parameters

int $productId
int $userId

Return Value

array