class GiftCardRepository extends EntityRepository

Class GiftCardRepository is injected as empire_gift_card_plugin.repository service. GiftCardRepository is used for crud operation for entity.

Use this class to work with database.

Traits

Trait JQGridTrait

Constants

ALIAS

Alias for main entity

USER_ALIAS

Alias fo User

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

saveGiftCard(GiftCard $card)

Persist GiftCard entity

editGiftCard(GiftCard $card)

Merge GiftCard entity

getReference(int $id)

Get refference to GiftCard entity

getGiftCard(int $id)

Get GiftCart and its user form database by id

GiftCard|null
getGiftCardByCode(string $code)

Get GiftCart by code

bool
deleteGiftCards(array $ids)

Delete multiple GiftCards

array
getAllGiftCards(User $user, int $page, int $offset)

Get multiple gift cards for specified user

int|string
getCountForPagination(User $user)

Get total number of gift cards for 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 48
GiftCard saveGiftCard(GiftCard $card)

Persist GiftCard entity

Parameters

GiftCard $card

Return Value

GiftCard

at line 67
GiftCard editGiftCard(GiftCard $card)

Merge GiftCard entity

Parameters

GiftCard $card

Return Value

GiftCard

at line 88
GiftCard getReference(int $id)

Get refference to GiftCard entity

Parameters

int $id

Return Value

GiftCard

Exceptions

ORMException

at line 103
GiftCard getGiftCard(int $id)

Get GiftCart and its user form database by id

Parameters

int $id

Return Value

GiftCard

Exceptions

NoResultException
NonUniqueResultException

at line 121
GiftCard|null getGiftCardByCode(string $code)

Get GiftCart by code

Parameters

string $code

Return Value

GiftCard|null

at line 142
bool deleteGiftCards(array $ids)

Delete multiple GiftCards

Parameters

array $ids
  • Delete every gift card whose id is in this array

Return Value

bool FALSE on error, TRUE otherwise

at line 169
array getAllGiftCards(User $user, int $page, int $offset)

Get multiple gift cards for specified user

Parameters

User $user
int $page
  • page of data
int $offset
  • number of items

Return Value

array

at line 193
int|string getCountForPagination(User $user)

Get total number of gift cards for user

Parameters

User $user

Return Value

int|string

Exceptions

NonUniqueResultException