Compare commits

...

6 Commits

Author SHA1 Message Date
AUDUL d745d8ed60 Fix BillingAddressComparator (#7)
* Fix BillingAddressComparator
2026-04-16 10:24:46 +02:00
Jérémy J b2f9ac49d6 Add missing status labels 2026-03-31 16:49:28 +02:00
loic 2bde5af903 update changelog 2026-03-03 14:14:17 +01:00
loic 63190e894b add product attributes comparator 2026-03-03 13:48:21 +01:00
loic a682881db9 add product attributes 2026-03-03 10:56:32 +01:00
loic 957b270bbe fix taxonomy comparator 2026-01-27 13:07:30 +01:00
12 changed files with 81 additions and 6 deletions
+17
View File
@@ -1,3 +1,20 @@
# Version 6.1.2
* Fix BillingAddressComparator
# Version 6.1.1
* Add missing status labels
# Version 6.1.0
* Add `ibexa_product_specification` comparator
* Add `attributes` in `ProductCreateStructure` and `ProductUpdateStructure`
# Version 6.0.1
* Fix taxonomy comparator
# Version 6.0.0
* Ibexa 5.0+ support
* Comparators for Ibexa Commerce / Experience field types
# Version 5.2.1
* Fixed datepicker in oneshot modal
+1
View File
@@ -257,6 +257,7 @@ the `NotModifiedContentFilter` to prevent unnecessary overhead.
- ibexa_taxonomy_entry_assignment
- ibexa_address
- ibexa_customer_group
- ibexa_product_specification
### Add custom field comparator
@@ -13,6 +13,9 @@ class BillingAddressComparator extends AbstractFieldComparator
*/
protected function compareValues(Value $currentValue, Value $newValue): bool
{
return empty(array_diff_assoc($currentValue->fields, $newValue->fields)) && $currentValue->name === $newValue->name && $currentValue->country === $newValue->country;
return \count($currentValue->fields) === \count($newValue->fields)
&& empty(array_diff_assoc($currentValue->fields, $newValue->fields))
&& $currentValue->name === $newValue->name
&& $currentValue->country === $newValue->country;
}
}
@@ -0,0 +1,25 @@
<?php
declare(strict_types=1);
namespace CodeRhapsodie\IbexaDataflowBundle\Core\FieldComparator;
use Ibexa\Contracts\Core\FieldType\Value;
class ProductSpecificationComparator extends AbstractFieldComparator
{
protected function compareValues(Value $currentValue, Value $newValue): bool
{
$currentAttributes = $currentValue->getAttributes();
$newAttributes = $newValue->getAttributes();
if ($newValue->isCodeChanged() || $currentValue->isVirtual() !== $newValue->isVirtual() || \count($currentAttributes) !== \count($newAttributes)) {
return false;
}
sort($currentAttributes);
sort($newAttributes);
return $currentAttributes === $newAttributes;
}
}
@@ -32,6 +32,13 @@ class TaxonomyEntryAssignmentComparator extends AbstractFieldComparator
return $newEntry->id;
}, $newEntries);
return empty(array_diff($currentEntriesId, $newEntriesId));
if (\count($currentEntriesId) !== \count($newEntriesId)) {
return false;
}
sort($currentEntriesId);
sort($newEntriesId);
return $currentEntriesId === $newEntriesId;
}
}
+3 -1
View File
@@ -6,10 +6,12 @@ namespace CodeRhapsodie\IbexaDataflowBundle\Model;
class ProductCreateStructure extends ProductStructure
{
public function __construct(string $code, array $fields, string $languageCode)
public function __construct(string $code, array $fields, string $languageCode, int $stock = 0, array $attributes = [])
{
$this->code = $code;
$this->fields = $fields;
$this->languageCode = $languageCode;
$this->stock = $stock;
$this->attributes = $attributes;
}
}
+7
View File
@@ -12,6 +12,8 @@ abstract class ProductStructure
protected int $stock;
protected array $attributes;
public function getCode(): string
{
@@ -32,4 +34,9 @@ abstract class ProductStructure
{
return $this->stock;
}
public function getAttributes(): array
{
return $this->attributes;
}
}
+2 -1
View File
@@ -10,12 +10,13 @@ class ProductUpdateStructure extends ProductStructure
protected bool $updateStock = true;
public function __construct(string $code, array $fields, string $languageCode, int $stock = 0)
public function __construct(string $code, array $fields, string $languageCode, int $stock = 0, array $attributes = [])
{
$this->code = $code;
$this->fields = $fields;
$this->languageCode = $languageCode;
$this->stock = $stock;
$this->attributes = $attributes;
}
public function isUpdateContent(): bool
@@ -56,3 +56,7 @@ services:
tags:
- { name: 'coderhapsodie.ibexa_dataflow.field_comparator', fieldType: 'ibexa_customer_group' }
CodeRhapsodie\IbexaDataflowBundle\Core\FieldComparator\ProductSpecificationComparator:
parent: 'CodeRhapsodie\IbexaDataflowBundle\Core\FieldComparator\AbstractFieldComparator'
tags:
- { name: 'coderhapsodie.ibexa_dataflow.field_comparator', fieldType: 'ibexa_product_specification' }
+3 -1
View File
@@ -34,6 +34,8 @@ coderhapsodie.ibexa_dataflow.history.filter.with_error_only: Only with errors
coderhapsodie.ibexa_dataflow.job.status.pending: Pending
coderhapsodie.ibexa_dataflow.job.status.running: Running
coderhapsodie.ibexa_dataflow.job.status.complete: Completed
coderhapsodie.ibexa_dataflow.job.status.queued: Queued
coderhapsodie.ibexa_dataflow.job.status.crashed: Crashed
coderhapsodie.ibexa_dataflow.job.status.unknown: Unknown
coderhapsodie.ibexa_dataflow.history.job.title: 'Job'
coderhapsodie.ibexa_dataflow.history.details.title: 'Job details'
@@ -86,4 +88,4 @@ coderhapsodie.ibexa_dataflow.notfound: 'Requested data is not found'
coderhapsodie.ibexa_dataflow.powered_by: 'Powered by'
coderhapsodie.ibexa_dataflow.made_by: 'Made by'
coderhapsodie.ibexa_dataflow.dashboard: Dashboard
coderhapsodie.ibexa_dataflow.dashboard.title: Running or waiting tasks
coderhapsodie.ibexa_dataflow.dashboard.title: Running or waiting tasks
+3 -1
View File
@@ -34,6 +34,8 @@ coderhapsodie.ibexa_dataflow.history.filter.with_error_only: Seulement avec erre
coderhapsodie.ibexa_dataflow.job.status.pending: 'En attente'
coderhapsodie.ibexa_dataflow.job.status.running: 'En cours'
coderhapsodie.ibexa_dataflow.job.status.complete: Terminé
coderhapsodie.ibexa_dataflow.job.status.queued: File d'attente
coderhapsodie.ibexa_dataflow.job.status.crashed: Planté
coderhapsodie.ibexa_dataflow.job.status.unknown: Inconnu
coderhapsodie.ibexa_dataflow.history.job.title: 'Exécution'
coderhapsodie.ibexa_dataflow.history.details.title: 'Détails de l''exécution'
@@ -84,4 +86,4 @@ coderhapsodie.ibexa_dataflow.notfound: 'Les données demandées sont introuvable
coderhapsodie.ibexa_dataflow.powered_by: 'Propulsé par'
coderhapsodie.ibexa_dataflow.made_by: 'Fabriqué par'
coderhapsodie.ibexa_dataflow.dashboard: Dashboard
coderhapsodie.ibexa_dataflow.dashboard.title: Tâches en cours ou en attente
coderhapsodie.ibexa_dataflow.dashboard.title: Tâches en cours ou en attente
@@ -5,6 +5,10 @@
{{ 'coderhapsodie.ibexa_dataflow.job.status.running'|trans }}
{% elseif status == 2 %}
{{ 'coderhapsodie.ibexa_dataflow.job.status.complete'|trans }}
{% elseif status == 3 %}
{{ 'coderhapsodie.ibexa_dataflow.job.status.queued'|trans }}
{% elseif status == 4 %}
{{ 'coderhapsodie.ibexa_dataflow.job.status.crashed'|trans }}
{% else %}
{{ 'coderhapsodie.ibexa_dataflow.job.status.unknown'|trans }}
{% endif %}