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

Trait JQGridTrait
Class AvailabilityChangeRepositoryTrait

Constants

ALIAS

Brand alias

IMAGE_ALIAS

Image alias

BLOCK_ELEMENTS_RESULT_CACHE

Block elements result cache key

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

productLimitDataDQL(QueryBuilder $qb, array $limitData)

No description

string
productLimitDataSQL(string $productAlias, array $limitData, bool $addAnd = true)

No description

brandLimitDataDQL(QueryBuilder $qb, array $limitData, string $brandAlias = null)

No description

EntityManager
getEM()

No description

getDBBrand(int $brandId)

Get brand from database

array
getAllBrandsIdAndCode()

Get all brands id and code

array
getAllBrandsIdAndName()

Get all brands id and name

bool|Proxy|null|object
getBrandReference(int $id)

Get brand reference by id

getDBBrandObj(int $brandId)

Get brand object from database by id

getDBBrandObject(Brand $brand)

Get brand object from database for id using default doctrine method

array
getAllDBBrandObjects(array $arrayOfBrands)

Get all database objects for provided array

beginCustomTransaction()

Begin transaction

commitCustomTransaction()

Commit transaction

mixed
save(Brand $object)

Persist object to database

bool
removeArray(array $arrayOfEntities)

Remove array of objects from database

removeArrayCSV(array $arrayOfEntities)

Remove array of entities for CSV

edit(Brand $entity)

Edit brand entity in database

QueryBuilder
getMegamenuBrands()

Get brands for megamenu

array
getBrandsSlugs()

Get all brand slugs

array
findAllBrandsForProductPage()

Find all brands for product page

array
getAllBrands()

Get all brands slug, name and image

array
findAllBrandsForFilter()

Get all brands for filter

mixed
getAllBrandsPagination(string|int $page, string|int $offset)

Get all brands with pagination

array
countAllBrandsPagination()

Count all brands for pagination data

array
getAllBrandsForCSV()

Get all brands for CSV

mixed
saveCSV(ArrayCollection $objectList)

Save object list for CSV

getDBBrandWithoutTranslation(Brand $brand)

Get brand from database without translation

getDbBrandByCode(string $code)

Get brand from database by code

mixed
getBrandMetadata()

Get brand class metadata

mixed
getCustomBrandFieldsForExport(array $fields)

Get custom brand fields for export

bool
reorderBrands(array $brands)

Reorder brands

array
getEntitiesForBlockElementsExtension(array $ids, mixed $limitData = null)

Get brands for brand block

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
searchBrands(Filter $filter, int $page, int $offset, bool $isCountSearch = false)

Search brands using Filter

deleteResultCaches()

Delete all cached results

array
executeCustomSql(string $sql)

Execute custom sql

mixed
getBrandBySlug(string $slug)

Get brand object from databse by slug

getReference(int $id)

Get brand reference by id

startTransaction()

Start transaction

commitTransaction()

Commit transaction

rollbackTransaction()

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

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

productLimitDataDQL(QueryBuilder $qb, array $limitData)

Parameters

QueryBuilder $qb
array $limitData

string productLimitDataSQL(string $productAlias, array $limitData, bool $addAnd = true)

Parameters

string $productAlias
array $limitData
bool $addAnd

Return Value

string

brandLimitDataDQL(QueryBuilder $qb, array $limitData, string $brandAlias = null)

Parameters

QueryBuilder $qb
array $limitData
string $brandAlias

at line 50
EntityManager getEM()

Return Value

EntityManager

at line 64
Brand getDBBrand(int $brandId)

Get brand from database

Parameters

int $brandId

Return Value

Brand

Exceptions

NoResultException
NonUniqueResultException

at line 88
array getAllBrandsIdAndCode()

Get all brands id and code

Return Value

array

at line 101
array getAllBrandsIdAndName()

Get all brands id and name

Return Value

array

at line 125
bool|Proxy|null|object getBrandReference(int $id)

Get brand reference by id

Parameters

int $id

Return Value

bool|Proxy|null|object

Exceptions

ORMException

at line 139
Brand getDBBrandObj(int $brandId)

Get brand object from database by id

Parameters

int $brandId

Return Value

Brand

Exceptions

NoResultException
NonUniqueResultException

at line 155
Brand getDBBrandObject(Brand $brand)

Get brand object from database for id using default doctrine method

Parameters

Brand $brand

Return Value

Brand

at line 166
array getAllDBBrandObjects(array $arrayOfBrands)

Get all database objects for provided array

Parameters

array $arrayOfBrands int $arrayOfBrands

Return Value

array Brand

at line 178
beginCustomTransaction()

Begin transaction

at line 186
commitCustomTransaction()

Commit transaction

at line 199
mixed save(Brand $object)

Persist object to database

Parameters

Brand $object

Return Value

mixed

Exceptions

Exception

at line 220
bool removeArray(array $arrayOfEntities)

Remove array of objects from database

Parameters

array $arrayOfEntities

Return Value

bool

Exceptions

Exception

at line 245
removeArrayCSV(array $arrayOfEntities)

Remove array of entities for CSV

Parameters

array $arrayOfEntities

Exceptions

Exception

at line 266
Brand edit(Brand $entity)

Edit brand entity in database

Parameters

Brand $entity

Return Value

Brand

Exceptions

Exception

at line 285
QueryBuilder getMegamenuBrands()

Get brands for megamenu

Return Value

QueryBuilder

at line 304
array getBrandsSlugs()

Get all brand slugs

Return Value

array

at line 318
array findAllBrandsForProductPage()

Find all brands for product page

Return Value

array

at line 331
array getAllBrands()

Get all brands slug, name and image

Return Value

array

at line 344
array findAllBrandsForFilter()

Get all brands for filter

Return Value

array

at line 359
mixed getAllBrandsPagination(string|int $page, string|int $offset)

Get all brands with pagination

Parameters

string|int $page
string|int $offset

Return Value

mixed

at line 381
array countAllBrandsPagination()

Count all brands for pagination data

Return Value

array

at line 394
array getAllBrandsForCSV()

Get all brands for CSV

Return Value

array

at line 407
mixed saveCSV(ArrayCollection $objectList)

Save object list for CSV

Parameters

ArrayCollection $objectList

Return Value

mixed

Exceptions

Exception

at line 448
Brand getDBBrandWithoutTranslation(Brand $brand)

Get brand from database without translation

Parameters

Brand $brand

Return Value

Brand

Exceptions

NoResultException
NonUniqueResultException

at line 467
Brand getDbBrandByCode(string $code)

Get brand from database by code

Parameters

string $code

Return Value

Brand

Exceptions

NoResultException
NonUniqueResultException

at line 481
mixed getBrandMetadata()

Get brand class metadata

Return Value

mixed

at line 492
mixed getCustomBrandFieldsForExport(array $fields)

Get custom brand fields for export

Parameters

array $fields

Return Value

mixed

at line 531
bool reorderBrands(array $brands)

Reorder brands

Parameters

array $brands

Return Value

bool

at line 562
array getEntitiesForBlockElementsExtension(array $ids, mixed $limitData = null)

Get brands for brand block

Parameters

array $ids
mixed $limitData

Return Value

array

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

Parameters

array $ids

Return Value

array

at line 626
array searchBrands(Filter $filter, int $page, int $offset, bool $isCountSearch = false)

Search brands using Filter

Parameters

Filter $filter
int $page
int $offset
bool $isCountSearch

Return Value

array

See also

Filter

at line 663
deleteResultCaches()

Delete all cached results

at line 676
array executeCustomSql(string $sql)

Execute custom sql

Parameters

string $sql

Return Value

array

Exceptions

Exception

at line 694
mixed getBrandBySlug(string $slug)

Get brand object from databse by slug

Parameters

string $slug

Return Value

mixed

Exceptions

NonUniqueResultException

at line 710
Brand getReference(int $id)

Get brand reference by id

Parameters

int $id

Return Value

Brand

Exceptions

ORMException

at line 718
protected startTransaction()

Start transaction

at line 726
protected commitTransaction()

Commit transaction

at line 734
protected rollbackTransaction()

Rollback transaction