class PricelistRepository extends EntityRepository

Class PricelistRepository is injected as alligator_pricelist.repository service. PricelistRepository is used for crud operation for entity.

Use this class to work with database.

Constants

ALIAS

Alias for main entity

USER_SPECIFIC_ALIAS

Alias for user specific discounts

USER_ALIAS

Alias for user

DEFAULT_PRICELIST_CACHED

Key for caching

Methods

array
getPricelistsForBackend()

Get all price lists as array

array
getPricelistsForUser(mixed $id)

Get all pricelist for specified user

PriceList
getPricelistById(mixed $id)

Get single price list by id

PriceList
getReference(mixed $id)

Get reference to object

edit(Pricelist $pricelist)

Merge specified Pricelist

savePricelist(Pricelist $pricelist)

Persist new Pricelist

mixed
delete(mixed $pricelist)

Delete single Pricelist

mixed
getDefaultPricelist()

Get default pricelist Cache this result

bool
setAsDefault(mixed $id)

Set Pricelist as default, update currentPrice field for products

array
getAllPricelists()

Get id and erp code of all pricelists

array
getPricelistsArrayFromDB(array $ids)

Get Pricelist from database where id is in specified array

Pricelist|null
getPricelistForERPCode(string $code)

Get single Pricelist with specified code

Details

at line 51
array getPricelistsForBackend()

Get all price lists as array

Return Value

array

at line 65
array getPricelistsForUser(mixed $id)

Get all pricelist for specified user

Parameters

mixed $id

Return Value

array

at line 87
PriceList getPricelistById(mixed $id)

Get single price list by id

Parameters

mixed $id

Return Value

PriceList

Exceptions

NonUniqueResultException
NoResultException

at line 103
PriceList getReference(mixed $id)

Get reference to object

Parameters

mixed $id

Return Value

PriceList

at line 114
Pricelist edit(Pricelist $pricelist)

Merge specified Pricelist

Parameters

Pricelist $pricelist

Return Value

Pricelist

at line 135
Pricelist savePricelist(Pricelist $pricelist)

Persist new Pricelist

Parameters

Pricelist $pricelist

Return Value

Pricelist

at line 154
mixed delete(mixed $pricelist)

Delete single Pricelist

Parameters

mixed $pricelist

Return Value

mixed

Exceptions

OptimisticLockException

at line 171
mixed getDefaultPricelist()

Get default pricelist Cache this result

Return Value

mixed

at line 195
bool setAsDefault(mixed $id)

Set Pricelist as default, update currentPrice field for products

Parameters

mixed $id

Return Value

bool

at line 237
array getAllPricelists()

Get id and erp code of all pricelists

Return Value

array

at line 251
array getPricelistsArrayFromDB(array $ids)

Get Pricelist from database where id is in specified array

Parameters

array $ids

Return Value

array

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

Get single Pricelist with specified code

Parameters

string $code

Return Value

Pricelist|null

Exceptions

NonUniqueResultException