AttributeValueRepository
class AttributeValueRepository extends EntityRepository implements AbstractBlockElementRepositoryInterface
Class AttributeValueRepository is injected as alligator.attribute_value_repository service. AttributeValueRepository is used for crud operation for entity.
Use this class to work with database.
Traits
Constants
| ATTRIBUTE_VALUE_BLOCKS_RESULT_CACHE |
|
| ALIAS |
Alias for entity |
| ATTRIBUTE_ALIAS |
Alias for attribute entity |
Methods
Should contain group by which jqgrid uses.
JQGrid function
JQGrid function
Find attribute value by name. Error if there is more value swith same name
Retrieve reference for provided class(attribute value by default)
Persist multiple attribute values entities
Find id and code of all attribute values
Find all attribute values that match provided codes
Find id and value of all attribute values
Get entities from database by ids Tis method is used to for block elements extension Make sure you order data by ids - ids is array of elements and it is sorted by priority - so add this to select -> ' FIELD('.self::ALIAS.'.id'.', '.implode(', ', $ids).') AS sort_col'); - and order by this field Also make sure you cache this data -> qb->useQueryCache(true)->useResultCache(true, 3600)
Get id and name (field must be name so change it in select) of entity Used in event for block element edit Make sure you order data by ids - ids is array of elements and it is sorted by priority - so add this to select -> ' FIELD('.self::ALIAS.'.id'.', '.implode(', ', $ids).') AS sort_col'); - and order by this field
Change order for attribute values in attribute
Delete attribute value by id, and update priority of all attribute values in attribute
Find id of all attribute values that match provided names
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
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
in JQGridTrait at line 61
array
findAllForJQGRID(int $page, int $offset, array $sortParams, array $additionalParams, JQGridWrapper $jqGridWrapper)
JQGrid function
in JQGridTrait at line 94
array
searchForJQGRID(array $searchParams, array $sortParams, bool $isCountSearch = false, array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)
JQGrid function
at line 52
AttributeValue
save(AttributeValue $entity)
Persist new attribute value
at line 71
AttributeValue
edit(AttributeValue $entity)
Update attribute value
at line 92
AttributeValue|null
findAttributeValueByName(string $name)
Find attribute value by name. Error if there is more value swith same name
at line 111
AttributeValue|Proxy|null|object
getReference(int $id, string $class = AttributeValue::class)
Retrieve reference for provided class(attribute value by default)
at line 124
bool|string
saveMultiple(array $attributeValues, int $flushNumber = 30)
Persist multiple attribute values entities
at line 153
array
getAllAttributeValueErpCodes()
Find id and code of all attribute values
at line 168
array
findMultipleByErpCode(array $arrayCodes)
Find all attribute values that match provided codes
at line 181
array
getAllAttributeValuesNameAndId()
Find id and value of all attribute values
at line 200
array
getEntitiesForBlockElementsExtension(array $ids)
Get entities from database by ids Tis method is used to for block elements extension Make sure you order data by ids - ids is array of elements and it is sorted by priority - so add this to select -> ' FIELD('.self::ALIAS.'.id'.', '.implode(', ', $ids).') AS sort_col'); - and order by this field Also make sure you cache this data -> qb->useQueryCache(true)->useResultCache(true, 3600)
at line 230
array
getEntityNamesForIds(array $ids)
Get id and name (field must be name so change it in select) of entity Used in event for block element edit Make sure you order data by ids - ids is array of elements and it is sorted by priority - so add this to select -> ' FIELD('.self::ALIAS.'.id'.', '.implode(', ', $ids).') AS sort_col'); - and order by this field
at line 254
bool
changeOrder(int $id, int $newIndex, int $attribute)
Change order for attribute values in attribute
at line 294
boolean|string
deleteValue(int $id, int $attribute)
Delete attribute value by id, and update priority of all attribute values in attribute
at line 329
array
findAttributeValueIdsByValues(array $values)
Find id of all attribute values that match provided names