class PricelistManager implements BasicEntityManagerInterface

Class PricelistManager is injected as alligator.pricelist.manager service. PricelistManager handles the logic for entity.

Properties

protected PricelistRepository $repository

Methods

__construct(PricelistRepository $repository, PricelistEventContainer $eventContainer)

PricelistManager constructor.

savePricelist(Pricelist $entity)

Persist new Pricelist

array
getAllPricelists()

Get id and erp code of all pricelists

array
findAllPricelists()

Get all pricelists

array
getPricelistsForBackend()

Get all price lists as array

array
getPricelistsForUser(mixed $id)

Get all pricelist for specified user

handlePersist(Pricelist $pricelist)

Save or edit pricelist

PriceList
getReference(mixed $id)

Get reference to object

mixed
getDefaultPricelist()

Get default pricelist Cache this result

bool
setAsDefault(mixed $id)

Set Pricelist as default, update currentPrice field for products

mixed
deleteList(mixed $id)

Get single price list by id

dispatchOnPricelistChanged(mixed $pricelistId)

Dispatch event to recalculate pricelist data

getPricelistForId(mixed $id)

Get single Pricelist for id

Pricelist|null
getPricelistForERPCode(string $code)

Get single Pricelist with specified code

Details

at line 35
__construct(PricelistRepository $repository, PricelistEventContainer $eventContainer)

PricelistManager constructor.

Parameters

PricelistRepository $repository
PricelistEventContainer $eventContainer

at line 47
Pricelist savePricelist(Pricelist $entity)

Persist new Pricelist

Parameters

Pricelist $entity

Return Value

Pricelist

at line 56
array getAllPricelists()

Get id and erp code of all pricelists

Return Value

array

at line 65
array findAllPricelists()

Get all pricelists

Return Value

array

at line 74
array getPricelistsForBackend()

Get all price lists as array

Return Value

array

at line 85
array getPricelistsForUser(mixed $id)

Get all pricelist for specified user

Parameters

mixed $id

Return Value

array

at line 99
Pricelist handlePersist(Pricelist $pricelist)

Save or edit pricelist

Parameters

Pricelist $pricelist

Return Value

Pricelist

Exceptions

NoResultException
NonUniqueResultException

at line 124
PriceList getReference(mixed $id)

Get reference to object

Parameters

mixed $id

Return Value

PriceList

at line 135
mixed getDefaultPricelist()

Get default pricelist Cache this result

Return Value

mixed

at line 146
bool setAsDefault(mixed $id)

Set Pricelist as default, update currentPrice field for products

Parameters

mixed $id

Return Value

bool

at line 166
mixed deleteList(mixed $id)

Get single price list by id

Parameters

mixed $id

Return Value

mixed

Exceptions

NoResultException
NonUniqueResultException
OptimisticLockException

at line 177
dispatchOnPricelistChanged(mixed $pricelistId)

Dispatch event to recalculate pricelist data

Parameters

mixed $pricelistId

at line 188
Pricelist getPricelistForId(mixed $id)

Get single Pricelist for id

Parameters

mixed $id

Return Value

Pricelist

at line 201
Pricelist|null getPricelistForERPCode(string $code)

Get single Pricelist with specified code

Parameters

string $code

Return Value

Pricelist|null

Exceptions

NonUniqueResultException