class CatalogueManager implements BasicEntityManagerInterface

Class CatalogueManager is injected as empire_digital_catalogue_plugin.catalogue_manager service. CatalogueManager handles the logic for managed entity.

Traits

Trait JQGridManagerTrait

Constants

DIGITAL_CATALOGUE_GENERATE_SIGNAL

Digital catalogue generate signal event key

DIGITAL_CATALOGUE_TEMPLATE_SIGNAL

Digital catalogue template signal event key

Properties

protected CatalogueRepository $repository
protected CategoryManager $categoryManager
protected ContainerInterface $container

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

__construct(CatalogueRepository $repository, CategoryManager $categoryManager, ContainerInterface $container)

No description

array
getAllCategories()

Get all categories

array
getAllCategoriesIdAndName()

Get all categories with id and name

getDigitalCatalogueById(int $id)

Get catalogue by id

mixed
getDigitalCatalogueByIdWithSelect(int $id)

Get catalogue by id with select

array
getDigitalCatalogueForPrint(int $catalogueId)

Get digital catalogue for print

array
getDigitalCatalogueForPrintActionProducts(int $catalogueId)

Get digital catalogue action products for print

save(Catalogue $catalogue)

Persist catalogue object to database

edit(Catalogue $catalogue)

Edit digital catalogue object

mixed
hasRoleAdmin()

Check if current user has role admin

string
getCurrentLocale()

Get current locale

mixed
getCurrentCurrency()

Get current currency

array
getAllCataloguesFrontEnd()

Get all catalogues for frontend

bool
deleteCatalogues(array $array)

Delete catalogues from array

array
getCataloguesArray(array $catalogues)

Get catalogues array

QueryBuilder
getProductsForCategoryOrOnAction(mixed $param, mixed $page, int $offset, null $selectedProducts = null)

Get products for category or on action

dispatchGenerateCatalogueEvent(int $id, string $webPath)

Dispatch catalogue event signal

generateCataloguesForCategories(array $categories, string $currency, string $server)

Generate catalogues for categories

generateCatalogue(int|string $id, string $currency, string $serverPath, string $webPath, null|string $locale = null)

Generate catalogue pdf

dispatchCatalogTemplateEvent()

Dispatch catalogue template event

PDFGenerator|object
getPDFGenerator()

Get PDF generator service

mixed
getTemplatingEngine()

Get templating engine service

string
getServerPath()

Get server path

string
getWebPath()

Get web path

savePDFFile(Catalogue $catalogue)

Save PDF File for catalogue

array
handleFileUpload(mixed $file)

Handle file upload

removePFDFile(mixed $file)

Remove pdf file

mixed
sortCatalogues(int|string $id, int|string $newIndex)

Sort catalogues

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 65
__construct(CatalogueRepository $repository, CategoryManager $categoryManager, ContainerInterface $container)

Parameters

CatalogueRepository $repository
CategoryManager $categoryManager
ContainerInterface $container

at line 76
array getAllCategories()

Get all categories

Return Value

array

at line 85
array getAllCategoriesIdAndName()

Get all categories with id and name

Return Value

array

at line 96
Catalogue getDigitalCatalogueById(int $id)

Get catalogue by id

Parameters

int $id

Return Value

Catalogue

at line 110
mixed getDigitalCatalogueByIdWithSelect(int $id)

Get catalogue by id with select

Parameters

int $id

Return Value

mixed

Exceptions

NoResultException
NonUniqueResultException

at line 121
array getDigitalCatalogueForPrint(int $catalogueId)

Get digital catalogue for print

Parameters

int $catalogueId

Return Value

array

at line 132
array getDigitalCatalogueForPrintActionProducts(int $catalogueId)

Get digital catalogue action products for print

Parameters

int $catalogueId

Return Value

array

at line 146
Catalogue save(Catalogue $catalogue)

Persist catalogue object to database

Parameters

Catalogue $catalogue

Return Value

Catalogue

Exceptions

NonUniqueResultException
Exception

at line 259
Catalogue edit(Catalogue $catalogue)

Edit digital catalogue object

Parameters

Catalogue $catalogue

Return Value

Catalogue

Exceptions

Exception

at line 369
mixed hasRoleAdmin()

Check if current user has role admin

Return Value

mixed

at line 379
string getCurrentLocale()

Get current locale

Return Value

string

at line 388
mixed getCurrentCurrency()

Get current currency

Return Value

mixed

at line 397
array getAllCataloguesFrontEnd()

Get all catalogues for frontend

Return Value

array

at line 416
bool deleteCatalogues(array $array)

Delete catalogues from array

Parameters

array $array

Return Value

bool

at line 440
array getCataloguesArray(array $catalogues)

Get catalogues array

Parameters

array $catalogues

Return Value

array

at line 454
QueryBuilder getProductsForCategoryOrOnAction(mixed $param, mixed $page, int $offset, null $selectedProducts = null)

Get products for category or on action

Parameters

mixed $param
mixed $page
int $offset
null $selectedProducts

Return Value

QueryBuilder

at line 464
dispatchGenerateCatalogueEvent(int $id, string $webPath)

Dispatch catalogue event signal

Parameters

int $id
string $webPath

at line 478
generateCataloguesForCategories(array $categories, string $currency, string $server)

Generate catalogues for categories

Parameters

array $categories
string $currency
string $server

at line 495
generateCatalogue(int|string $id, string $currency, string $serverPath, string $webPath, null|string $locale = null)

Generate catalogue pdf

Parameters

int|string $id
string $currency
string $serverPath
string $webPath
null|string $locale

at line 642
EventWithResult|Event dispatchCatalogTemplateEvent()

Dispatch catalogue template event

Return Value

EventWithResult|Event

at line 651
PDFGenerator|object getPDFGenerator()

Get PDF generator service

Return Value

PDFGenerator|object

at line 660
mixed getTemplatingEngine()

Get templating engine service

Return Value

mixed

at line 669
string getServerPath()

Get server path

Return Value

string

at line 678
string getWebPath()

Get web path

Return Value

string

at line 689
savePDFFile(Catalogue $catalogue)

Save PDF File for catalogue

Parameters

Catalogue $catalogue

Exceptions

Exception

at line 720
array handleFileUpload(mixed $file)

Handle file upload

Parameters

mixed $file

Return Value

array

at line 747
removePFDFile(mixed $file)

Remove pdf file

Parameters

mixed $file

at line 765
mixed sortCatalogues(int|string $id, int|string $newIndex)

Sort catalogues

Parameters

int|string $id
int|string $newIndex

Return Value

mixed

Exceptions

DBALException
NonUniqueResultException