BrandRepository
class BrandRepository extends EntityRepository implements AbstractBlockElementRepositoryInterface
Class BrandRepository is injected as alligator.brand_repository service. BrandRepository is used for crud operation for managed entity.
Use this class to work with database.
Traits
Constants
| ALIAS |
Brand alias |
| IMAGE_ALIAS |
Image alias |
| BLOCK_ELEMENTS_RESULT_CACHE |
Block elements result cache key |
Methods
Should contain group by which jqgrid uses.
JQGrid function
JQGrid function
No description
No description
No description
No description
Get brand from database
Get all brands id and code
Get all brands id and name
Get brand reference by id
Get brand object from database by id
Get all database objects for provided array
Begin transaction
Commit transaction
Remove array of objects from database
Remove array of entities for CSV
Get brands for megamenu
Get all brand slugs
Find all brands for product page
Get all brands slug, name and image
Get all brands for filter
Get all brands with pagination
Count all brands for pagination data
Get all brands for CSV
Save object list for CSV
Get brand from database by code
Get brand class metadata
Get custom brand fields for export
Reorder brands
Get brands for brand block
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
Search brands using Filter
Delete all cached results
Execute custom sql
Get brand object from databse by slug
Get brand reference by id
Start transaction
Commit transaction
Rollback transaction
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
in AvailabilityChangeRepositoryTrait at line 24
productLimitDataDQL(QueryBuilder $qb, array $limitData)
in AvailabilityChangeRepositoryTrait at line 56
string
productLimitDataSQL(string $productAlias, array $limitData, bool $addAnd = true)
in AvailabilityChangeRepositoryTrait at line 94
brandLimitDataDQL(QueryBuilder $qb, array $limitData, string $brandAlias = null)
at line 50
EntityManager
getEM()
at line 64
Brand
getDBBrand(int $brandId)
Get brand from database
at line 88
array
getAllBrandsIdAndCode()
Get all brands id and code
at line 101
array
getAllBrandsIdAndName()
Get all brands id and name
at line 125
bool|Proxy|null|object
getBrandReference(int $id)
Get brand reference by id
at line 139
Brand
getDBBrandObj(int $brandId)
Get brand object from database by id
at line 155
Brand
getDBBrandObject(Brand $brand)
Get brand object from database for id using default doctrine method
at line 166
array
getAllDBBrandObjects(array $arrayOfBrands)
Get all database objects for provided array
at line 178
beginCustomTransaction()
Begin transaction
at line 186
commitCustomTransaction()
Commit transaction
at line 199
mixed
save(Brand $object)
Persist object to database
at line 220
bool
removeArray(array $arrayOfEntities)
Remove array of objects from database
at line 245
removeArrayCSV(array $arrayOfEntities)
Remove array of entities for CSV
at line 285
QueryBuilder
getMegamenuBrands()
Get brands for megamenu
at line 304
array
getBrandsSlugs()
Get all brand slugs
at line 318
array
findAllBrandsForProductPage()
Find all brands for product page
at line 331
array
getAllBrands()
Get all brands slug, name and image
at line 344
array
findAllBrandsForFilter()
Get all brands for filter
at line 359
mixed
getAllBrandsPagination(string|int $page, string|int $offset)
Get all brands with pagination
at line 381
array
countAllBrandsPagination()
Count all brands for pagination data
at line 394
array
getAllBrandsForCSV()
Get all brands for CSV
at line 407
mixed
saveCSV(ArrayCollection $objectList)
Save object list for CSV
at line 448
Brand
getDBBrandWithoutTranslation(Brand $brand)
Get brand from database without translation
at line 467
Brand
getDbBrandByCode(string $code)
Get brand from database by code
at line 481
mixed
getBrandMetadata()
Get brand class metadata
at line 492
mixed
getCustomBrandFieldsForExport(array $fields)
Get custom brand fields for export
at line 531
bool
reorderBrands(array $brands)
Reorder brands
at line 562
array
getEntitiesForBlockElementsExtension(array $ids, mixed $limitData = null)
Get brands for brand block
at line 598
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 626
array
searchBrands(Filter $filter, int $page, int $offset, bool $isCountSearch = false)
Search brands using Filter
at line 663
deleteResultCaches()
Delete all cached results
at line 676
array
executeCustomSql(string $sql)
Execute custom sql
at line 694
mixed
getBrandBySlug(string $slug)
Get brand object from databse by slug
at line 710
Brand
getReference(int $id)
Get brand reference by id
at line 718
protected
startTransaction()
Start transaction
at line 726
protected
commitTransaction()
Commit transaction
at line 734
protected
rollbackTransaction()
Rollback transaction