class AttributeRepository extends EntityRepository

Class AttributeRepository is injected as alligator.attribute_repository service. AttributeRepository is used for crud operation for entity.

Use this class to work with database.

Traits

Trait JQGridTrait

Constants

ALIAS

Alias for entity

ATTRIBUTE_VALUE_ALIAS

Alias for attribute value entity

JOIN_WITH_ATTR_VALUE

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

save(Attribute $entity)

Persist new attribute

ClassMetadata
getCategoryMetadata()

Returns the ORM metadata descriptor for a class.

bool|string
saveMultiple(array $attributes, int $flushNumber = 30)

Save multiple attributes

edit(Attribute $entity)

Update attribute entity

bool
remove(array $entities)

Remove all provided attributes

array
getAll()

Find all attributes sorted by id in descending order

array
findAllAttributesWithAttributeValues()

Find all attributes(with attribute values)

array
findAttributeByIdWithAttributeValues(int $id)

Find attribute(with attribute values) for provided id

array
getAllAttributesWithAttributeValueArray()

Find all attributes(with attribute values) as ARRAY

array
getDBAttributes(array $array)

Find all attributes that match provided ids

mixed
findOneByPk(int $id)

Find attribute that match provided id

array
getCustomAttributeFieldsForExport(array $fields)

Custom export

beginCustomTransaction()

Used in csv import

rollbackCustomTransaction()

Used in csv import

commitCustomTransaction()

Used in csv import

mixed
saveCSV(ArrayCollection $objectList)

We are controlling transaction from the manager (begin, commit) We will only rollback in case of exception

array
getAllAttributeErpCodes()

Find id and code of all attributes(used in synchronization with erp)

Attribute|Proxy|null|object
getReference(int $id)

Retrieve reference for Attribute

bool
changeOrder(int $id, int $newIndex, int $attribute)

Change priority of attribute entity

array
findAllWithValues()

Find all attributes(with attribute values)

bool|string
setMissingPriorities()

Update priority for attributes

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

at line 53
Attribute save(Attribute $entity)

Persist new attribute

Parameters

Attribute $entity

Return Value

Attribute

at line 70
ClassMetadata getCategoryMetadata()

Returns the ORM metadata descriptor for a class.

Return Value

ClassMetadata

at line 83
bool|string saveMultiple(array $attributes, int $flushNumber = 30)

Save multiple attributes

Parameters

array $attributes
int $flushNumber

Return Value

bool|string

at line 114
Attribute edit(Attribute $entity)

Update attribute entity

Parameters

Attribute $entity

Return Value

Attribute

at line 133
bool remove(array $entities)

Remove all provided attributes

Parameters

array $entities

Return Value

bool

at line 158
array getAll()

Find all attributes sorted by id in descending order

Return Value

array

at line 170
array findAllAttributesWithAttributeValues()

Find all attributes(with attribute values)

Return Value

array

at line 189
array findAttributeByIdWithAttributeValues(int $id)

Find attribute(with attribute values) for provided id

Parameters

int $id

Return Value

array

Exceptions

NoResultException
NonUniqueResultException

at line 207
array getAllAttributesWithAttributeValueArray()

Find all attributes(with attribute values) as ARRAY

Return Value

array

at line 223
array getDBAttributes(array $array)

Find all attributes that match provided ids

Parameters

array $array

Return Value

array

at line 246
mixed findOneByPk(int $id)

Find attribute that match provided id

Parameters

int $id

Return Value

mixed

Exceptions

NoResultException
NonUniqueResultException

at line 262
array getCustomAttributeFieldsForExport(array $fields)

Custom export

Parameters

array $fields

Return Value

array

at line 292
beginCustomTransaction()

Used in csv import

at line 300
rollbackCustomTransaction()

Used in csv import

at line 308
commitCustomTransaction()

Used in csv import

at line 323
mixed saveCSV(ArrayCollection $objectList)

We are controlling transaction from the manager (begin, commit) We will only rollback in case of exception

Parameters

ArrayCollection $objectList

Return Value

mixed

Exceptions

Exception

at line 358
array getAllAttributeErpCodes()

Find id and code of all attributes(used in synchronization with erp)

Return Value

array

at line 374
Attribute|Proxy|null|object getReference(int $id)

Retrieve reference for Attribute

Parameters

int $id

Return Value

Attribute|Proxy|null|object

Exceptions

ORMException

at line 388
bool changeOrder(int $id, int $newIndex, int $attribute)

Change priority of attribute entity

Parameters

int $id
int $newIndex
int $attribute

Return Value

bool

at line 425
array findAllWithValues()

Find all attributes(with attribute values)

Return Value

array

at line 438
bool|string setMissingPriorities()

Update priority for attributes

Return Value

bool|string