BuyXRepository
class BuyXRepository extends EntityRepository implements AbstractBlockElementRepositoryInterface
Class BuyXRepository is injected as empire_buy_x_get_y_plugin.buy_x_repository service. BuyXRepository is used for crud operation for managed entity.
Use this class to work with database.
Traits
Constants
| BUY_X_GET_Y_BLOCKS_RESULT_CACHE |
Key for caching buy x get y offer |
| ALIAS |
Alias for buy x |
| Y_ALIAS |
Alias for get y |
| BUY_X_QUANTITY_ALIAS |
Alias for buy x quantity |
| PRODUCT_ALIAS |
Alias for buy x product |
| PRODUCT_Y_ALIAS |
Alias for get y product |
| SIMPLE_PRODUCT_Y_ALIAS |
Alias for simple product |
Methods
Should contain group by which jqgrid uses.
JQGrid function
JQGrid function
Remove buy x offers provided by array
Find bux offer by id
Find all buy x offers
Find buy x offer by id
Find all buy x and get y products for provided id
Find reference on buy x
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)
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
Find reference on entity by its class and id
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
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
in JQGridTrait at line 61
array
findAllForJQGRID(int $page, int $offset, array $sortParams, array $additionalParams, JQGridWrapper $jqGridWrapper)
JQGrid function
in JQGridTrait at line 94
array
searchForJQGRID(array $searchParams, array $sortParams, bool $isCountSearch = false, array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)
JQGrid function
at line 130
bool
removeFromArray(array $array)
Remove buy x offers provided by array
at line 161
mixed
getOfferForEdit(int $id)
Find bux offer by id
at line 187
array
getAllOffersForFrontEnd()
Find all buy x offers
at line 218
array
getOfferForProductPage(int $id)
Find buy x offer by id
at line 255
array
getProductsForDiscount(int $id)
Find all buy x and get y products for provided id
at line 279
BuyX
getReference(int $id)
Find reference on buy x
at line 287
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)
at line 315
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
at line 339
bool|Proxy|null|object
getReferenceForClass(string $class, int $id)
Find reference on entity by its class and id
at line 347
deleteResultCaches()
Delete all cached results