27 private $attributeRepository;
32 private $localeFormat;
37 private $metadataPool;
65 $this->metadataPool = $metadataPool;
66 $this->localeFormat = $localeFormat;
111 public function processDeletes(
$entityType, $context)
116 $metadata = $this->metadataPool->getMetadata(
$entityType);
124 foreach ($conditions as $condition) {
125 $metadata->getEntityConnection()->delete(
146 $metadata = $this->metadataPool->getMetadata(
$entityType);
147 $insertData = $this->prepareInsertDataForMultipleSave(
$entityType, $context);
149 foreach ($insertData as
$table => $tableData) {
150 foreach ($tableData as
$data) {
151 $metadata->getEntityConnection()->insertArray(
168 private function prepareInsertDataForMultipleSave(
$entityType, $context)
170 $metadata = $this->metadataPool->getMetadata(
$entityType);
176 $metadata->getEavEntityType(),
179 $attributeTable =
$attribute->getBackend()->getTable();
183 foreach ($conditions as $condition) {
184 $condition[
'value'] =
$value;
186 $columnsHash = implode(
'',
$columns);
187 $insertData[$attributeTable][$columnsHash][
'columns'] =
$columns;
188 $insertData[$attributeTable][$columnsHash][
'data'][] = array_values($condition);
203 public function processUpdates(
$entityType, $context)
208 $metadata = $this->metadataPool->getMetadata(
$entityType);
213 $metadata->getEavEntityType(),
218 foreach ($conditions as $condition) {
219 $metadata->getEntityConnection()->update(
248 'attribute_id = ?' =>
$attribute->getAttributeId(),
251 foreach ($scopes as $scope) {
278 'attribute_id = ?' =>
$attribute->getAttributeId(),
281 foreach ($scopes as $scope) {
308 'attribute_id' =>
$attribute->getAttributeId(),
311 foreach ($scopes as $scope) {
332 unset($this->
delete, $this->insert, $this->update);
344 $metadata = $this->metadataPool->getMetadata(
$entityType);
353 $describe = $metadata->getEntityConnection()->describeTable(
$attribute->getBackendTable());
354 return $metadata->getEntityConnection()->prepareColumnValue($describe[
'value'],
$value);
buildDeleteConditions(AbstractAttribute $attribute, EntityMetadataInterface $metadata, array $scopes, $linkFieldValue)
registerUpdate($entityType, $link, $attributeCode, $value)
elseif(isset( $params[ 'redirect_parent']))
buildUpdateConditions(AbstractAttribute $attribute, EntityMetadataInterface $metadata, array $scopes, $linkFieldValue)
processInserts($entityType, $context)
__construct(FormatInterface $localeFormat, AttributeRepositoryInterface $attributeRepository, MetadataPool $metadataPool)
flush($entityType, $context)
getScopeValue(ScopeInterface $scope, AbstractAttribute $attribute, $useDefault=false)
prepareValue($entityType, $value, AbstractAttribute $attribute)
registerInsert($entityType, $link, $attributeCode, $value)
registerDelete($entityType, $link, $attributeCode)
buildInsertConditions(AbstractAttribute $attribute, EntityMetadataInterface $metadata, array $scopes, $linkFieldValue)