class StoreRepository extends EntityRepository implements AbstractBlockElementRepositoryInterface

Class StoreRepository is injected as empire_store_locator_plugin.store_locator_repository service. StoreRepository is used for crud operation for entity.

Use this class to work with database.

Traits

Trait JQGridTrait

Constants

ADDRESS_ALIAS

MARKER_ALIAS

STORE_IMAGE_ALIAS

JOIN_WITH_ADDRESS

JOIN_WITH_STORE_IMAGE

JOIN_WITH_MARKER

ALIAS

STORE_LOCATOR_BLOCKS_RESULT_CACHE

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

mixed
findStoreByPk(mixed $id)

Find Store by id

save(Store $object)

Persist new Store

deleteStores(array $stores)

Delete multiple Store entities

array
getStoresArray(array $array)

Get Stores from database where id is in array

array
getAllStores()

Get all Stores from database

getStoreAddress(int $id)

Get Address from database

editStore(Store $store)

Merge Store entity

array
getEntitiesForBlockElementsExtension(array $ids)

Get entities from database by ids Tis method is used to for block elements extension Make sure you order data by ids - ids is array of elements and it is sorted by priority - so add this to select -> ' FIELD('.$this->getAlias().'.id'.', '.implode(', ', $ids).') AS sort_col'); - and order by this field Also make sure you cache this data -> qb->useQueryCache(true)->useResultCache(true, 3600)

array
getEntityNamesForIds(array $ids)

Get id and name (field must be name so change it in select) of entity Used in event for block element edit Make sure you order data by ids - ids is array of elements and it is sorted by priority - so add this to select -> ' FIELD('.$this->getAlias().'.id'.', '.implode(', ', $ids).') AS sort_col'); - and order by this field

array
getStoreForAddressId(mixed $addressId)

Get Stores for specified address

deleteResultCaches()

Delete all cached results

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 55
mixed findStoreByPk(mixed $id)

Find Store by id

Parameters

mixed $id

Return Value

mixed

Exceptions

NoResultException
NonUniqueResultException

at line 75
Store save(Store $object)

Persist new Store

Parameters

Store $object

Return Value

Store

Exceptions

ORMException
OptimisticLockException

at line 91
deleteStores(array $stores)

Delete multiple Store entities

Parameters

array $stores

Exceptions

ORMException
OptimisticLockException

at line 107
array getStoresArray(array $array)

Get Stores from database where id is in array

Parameters

array $array

Return Value

array

at line 122
array getAllStores()

Get all Stores from database

Return Value

array

at line 159
Address getStoreAddress(int $id)

Get Address from database

Parameters

int $id

Return Value

Address

at line 172
Store editStore(Store $store)

Merge Store entity

Parameters

Store $store

Return Value

Store

Exceptions

ORMException

at line 184
array getEntitiesForBlockElementsExtension(array $ids)

Get entities from database by ids Tis method is used to for block elements extension Make sure you order data by ids - ids is array of elements and it is sorted by priority - so add this to select -> ' FIELD('.$this->getAlias().'.id'.', '.implode(', ', $ids).') AS sort_col'); - and order by this field Also make sure you cache this data -> qb->useQueryCache(true)->useResultCache(true, 3600)

Parameters

array $ids

Return Value

array

at line 225
array getEntityNamesForIds(array $ids)

Get id and name (field must be name so change it in select) of entity Used in event for block element edit Make sure you order data by ids - ids is array of elements and it is sorted by priority - so add this to select -> ' FIELD('.$this->getAlias().'.id'.', '.implode(', ', $ids).') AS sort_col'); - and order by this field

Parameters

array $ids

Return Value

array

at line 247
array getStoreForAddressId(mixed $addressId)

Get Stores for specified address

Parameters

mixed $addressId

Return Value

array

at line 260
deleteResultCaches()

Delete all cached results