class BrandManager implements BrandManagerInterface, BasicEntityManagerInterface, CSVManagerInterface, JQGridInterface

Class BrandManager is injected as alligator.brand_manager service. BrandManager handles the logic for managed entity.

Traits

Trait JQGridManagerTrait
Class BlockElementManagerTrait. Handles reading data for block elements

Constants

WEB_UPLOADS_DIR

Web uploads directory path

TEMP_FOLDER_DIR

Temp uploads directory path

Properties

protected BrandRepository $repository
protected BrandEventContainer $eventContainer

Methods

mixed
searchForJQGRID(array $searchParams, array $sortParams = array(), array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

No description

mixed
findAllForJQGRID(int $page, int $offset, array $sortParams, array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

No description

mixed
getCountForJQGRID(array|null $searchParams = null, array|null $sortParams = null, array|null $additionalParams = array(), JQGridWrapper|null $jqGridWrapper = null)

No description

array
getEntitiesForBlockElementsExtension(array $ids)

Get brands for block elements extension

array
getEntityNamesForIds(array $ids)

Get id and name of entity

__construct(BrandRepository $repository, BrandEventContainer $eventContainer)

No description

getReference(int $id)

Get brand reference

array
findAllBrands()

Get all brands slug, name and image

array
findAllBrandsForFilter()

Get all brands for filter

array
findAllBrandsPagination(int $page, int $offset)

Get all brands with pagination

array
countAllBrands()

Count all brands for pagination data

array
findAllBrandsForProductPage()

Find all brands for product page

findBrand(int $brandId)

Get brand from database

mixed
saveBrand(Brand $brand)

Persist object to database

simpleSaveBrand(Brand $brand)

Simple persist object to database

mixed
deleteBrand(mixed $array)

Delete brands from provided array

mixed
editBrand(Brand $brand)

Edit brand object

mixed
getMegamenuBrands()

Get brands for megamenu

mixed|void
exportToCSV()

Export brands for CSV

mixed|void
exportCustom(array $data)

Custom export for CSV

getEntityObject()

Get new Brand object

mixed
importFromCSV(mixed $base64Content, mixed $locale, $propertyMappings = array())

Converts to appropriate entities and persists to database

bool
importImagesForBrand(mixed $name, mixed $base64)

Import images for brand

mixed
saveObjectsFromCSV(ArrayCollection $objectList, array $csvRow, array $entityCSVHeaders, array $propertyMappings = array())

Persist entities to database

getDbBrandByCode(string $code)

Get brand from database by code

getDBBrand(Brand $brand)

Get brand from database

getDBBrandObj(Brand $brand)

Get brand object from database by id

getBrandWithoutTranslation(Brand $brand)

Get brand from database without translation

mixed
getBrandsArray(array $array)

Get brands array for array with ids

getDBBrandObject(Brand $brand)

Get brand object from database

mixed
getBrandHtml(String $theme, String $locale)

Get brand html from cache for provided locale

mixed
getBrandsHtmlFromCache(string $locale)

Get brand html from cache for provided locale

mixed
generateBrandsHtml(String $theme, String $locale)

Generate brands html for cache

mixed
getTemplateEngine()

Get templating engine service

setBrandsHtmlToCache(string $brandHtml, string $locale)

Set brands html to cache

array
getBrandFieldsFromMetadata()

Get brand fields from metadata

mixed
getDBSettingsFields()

Get database settings fields

mixed
getCustomBrandFieldsForExport(array $fields)

Get custom brand export fields

array
getAvailableLanguages()

Get available languages

dispatchGenerateBrandTranslationSignal(Brand $brand)

Dispatch generate brand translation signal

bool
reorderBrands(array $brands)

Reorder brands

array
searchBrands(Filter $filter, int $page = 1, int $offset = 16, array $ignoreIds = [], null $category = null)

Search brands using Filter

mixed
getBrandReference(int $id)

Get brand reference by id

array
getAllBrandsIdAndCode()

Get all brands id and code

mixed
getAllBrandsIdAndName()

Get all brands id and name

null|object
findBrandByName(string $name)

Find brand object by brand name

array
findAttributeValueIdsByValues(array $values)

Find attribute value ids by values

array
executeCustomSql(string $sql)

Execute custom sql

updateBrandFields(Brand $brand)

Update brand fields

mixed
getBrandBySlug(string $slug)

Get brand object by slug

editImage(Brand $brandDB, Brand $brandReceived)

Edit image for current brand

Details

in JQGridManagerTrait at line 26
mixed searchForJQGRID(array $searchParams, array $sortParams = array(), array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

Parameters

array $searchParams
array $sortParams
array $additionalParams
JQGridWrapper $jqGridWrapper

Return Value

mixed

in JQGridManagerTrait at line 40
mixed findAllForJQGRID(int $page, int $offset, array $sortParams, array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

Parameters

int $page
int $offset
array $sortParams
array $additionalParams
JQGridWrapper $jqGridWrapper

Return Value

mixed

in JQGridManagerTrait at line 53
mixed getCountForJQGRID(array|null $searchParams = null, array|null $sortParams = null, array|null $additionalParams = array(), JQGridWrapper|null $jqGridWrapper = null)

Parameters

array|null $searchParams
array|null $sortParams
array|null $additionalParams
JQGridWrapper|null $jqGridWrapper

Return Value

mixed

at line 721
array getEntitiesForBlockElementsExtension(array $ids)

Get brands for block elements extension

Parameters

array $ids

Return Value

array

array getEntityNamesForIds(array $ids)

Get id and name of entity

Parameters

array $ids

Return Value

array

at line 69
__construct(BrandRepository $repository, BrandEventContainer $eventContainer)

Parameters

BrandRepository $repository
BrandEventContainer $eventContainer

at line 83
Brand getReference(int $id)

Get brand reference

Parameters

int $id

Return Value

Brand

Exceptions

ORMException

at line 92
array findAllBrands()

Get all brands slug, name and image

Return Value

array

at line 101
array findAllBrandsForFilter()

Get all brands for filter

Return Value

array

at line 113
array findAllBrandsPagination(int $page, int $offset)

Get all brands with pagination

Parameters

int $page
int $offset

Return Value

array

at line 122
array countAllBrands()

Count all brands for pagination data

Return Value

array

at line 131
array findAllBrandsForProductPage()

Find all brands for product page

Return Value

array

at line 145
Brand findBrand(int $brandId)

Get brand from database

Parameters

int $brandId

Return Value

Brand

Exceptions

NoResultException
NonUniqueResultException

at line 158
mixed saveBrand(Brand $brand)

Persist object to database

Parameters

Brand $brand

Return Value

mixed

Exceptions

Exception

at line 191
Brand simpleSaveBrand(Brand $brand)

Simple persist object to database

Parameters

Brand $brand

Return Value

Brand

Exceptions

Exception

at line 210
mixed deleteBrand(mixed $array)

Delete brands from provided array

Parameters

mixed $array

Return Value

mixed

Exceptions

Exception

at line 238
mixed editBrand(Brand $brand)

Edit brand object

Parameters

Brand $brand

Return Value

mixed

at line 281
mixed getMegamenuBrands()

Get brands for megamenu

Return Value

mixed

at line 292
mixed|void exportToCSV()

Export brands for CSV

Return Value

mixed|void

at line 303
mixed|void exportCustom(array $data)

Custom export for CSV

Parameters

array $data

Return Value

mixed|void

at line 312
CSVEntityInterface getEntityObject()

Get new Brand object

Return Value

CSVEntityInterface

at line 320
mixed importFromCSV(mixed $base64Content, mixed $locale, $propertyMappings = array())

Converts to appropriate entities and persists to database

Parameters

mixed $base64Content
mixed $locale
$propertyMappings

Return Value

mixed

at line 332
bool importImagesForBrand(mixed $name, mixed $base64)

Import images for brand

Parameters

mixed $name
mixed $base64

Return Value

bool

at line 396
mixed saveObjectsFromCSV(ArrayCollection $objectList, array $csvRow, array $entityCSVHeaders, array $propertyMappings = array())

Persist entities to database

Parameters

ArrayCollection $objectList
array $csvRow
array $entityCSVHeaders
array $propertyMappings

Return Value

mixed

at line 451
Brand getDbBrandByCode(string $code)

Get brand from database by code

Parameters

string $code

Return Value

Brand

Exceptions

NoResultException
NonUniqueResultException

at line 465
Brand getDBBrand(Brand $brand)

Get brand from database

Parameters

Brand $brand

Return Value

Brand

Exceptions

NoResultException
NonUniqueResultException

at line 479
Brand getDBBrandObj(Brand $brand)

Get brand object from database by id

Parameters

Brand $brand

Return Value

Brand

Exceptions

NoResultException
NonUniqueResultException

at line 493
Brand getBrandWithoutTranslation(Brand $brand)

Get brand from database without translation

Parameters

Brand $brand

Return Value

Brand

Exceptions

NoResultException
NonUniqueResultException

at line 504
mixed getBrandsArray(array $array)

Get brands array for array with ids

Parameters

array $array

Return Value

mixed

at line 515
Brand getDBBrandObject(Brand $brand)

Get brand object from database

Parameters

Brand $brand

Return Value

Brand

at line 527
mixed getBrandHtml(String $theme, String $locale)

Get brand html from cache for provided locale

Parameters

String $theme
String $locale

Return Value

mixed

at line 545
mixed getBrandsHtmlFromCache(string $locale)

Get brand html from cache for provided locale

Parameters

string $locale

Return Value

mixed

at line 557
mixed generateBrandsHtml(String $theme, String $locale)

Generate brands html for cache

Parameters

String $theme
String $locale

Return Value

mixed

at line 573
mixed getTemplateEngine()

Get templating engine service

Return Value

mixed

at line 583
setBrandsHtmlToCache(string $brandHtml, string $locale)

Set brands html to cache

Parameters

string $brandHtml
string $locale

at line 592
array getBrandFieldsFromMetadata()

Get brand fields from metadata

Return Value

array

at line 601
mixed getDBSettingsFields()

Get database settings fields

Return Value

mixed

at line 612
mixed getCustomBrandFieldsForExport(array $fields)

Get custom brand export fields

Parameters

array $fields

Return Value

mixed

at line 636
array getAvailableLanguages()

Get available languages

Return Value

array

at line 645
dispatchGenerateBrandTranslationSignal(Brand $brand)

Dispatch generate brand translation signal

Parameters

Brand $brand

at line 656
bool reorderBrands(array $brands)

Reorder brands

Parameters

array $brands

Return Value

bool

at line 678
array searchBrands(Filter $filter, int $page = 1, int $offset = 16, array $ignoreIds = [], null $category = null)

Search brands using Filter

Parameters

Filter $filter
int $page
int $offset
array $ignoreIds
null $category

Return Value

array

See also

Filter

at line 692
mixed getBrandReference(int $id)

Get brand reference by id

Parameters

int $id

Return Value

mixed

Exceptions

ORMException

at line 701
array getAllBrandsIdAndCode()

Get all brands id and code

Return Value

array

at line 710
mixed getAllBrandsIdAndName()

Get all brands id and name

Return Value

mixed

at line 734
null|object findBrandByName(string $name)

Find brand object by brand name

Parameters

string $name

Return Value

null|object

at line 745
array findAttributeValueIdsByValues(array $values)

Find attribute value ids by values

Parameters

array $values

Return Value

array

at line 758
array executeCustomSql(string $sql)

Execute custom sql

Parameters

string $sql

Return Value

array

Exceptions

Exception

at line 771
Brand updateBrandFields(Brand $brand)

Update brand fields

Parameters

Brand $brand

Return Value

Brand

Exceptions

Exception

at line 792
mixed getBrandBySlug(string $slug)

Get brand object by slug

Parameters

string $slug

Return Value

mixed

Exceptions

NonUniqueResultException

at line 802
protected editImage(Brand $brandDB, Brand $brandReceived)

Edit image for current brand

Parameters

Brand $brandDB
Brand $brandReceived