feat(fournisseurs) : categories (M2M) + telephones (1-N) + import customer.json
All checks were successful
Auto Tag Develop / tag (push) Successful in 9s
All checks were successful
Auto Tag Develop / tag (push) Successful in 9s
- Nouvelles entites ConstructeurCategorie (referentiel M2M) et ConstructeurTelephone (1-N) - Constructeur : retrait colonne phone, ajout collections telephones/categories, groupes de serialisation constructeur:read/write - Migration : cree les 3 tables, migre la colonne phone existante vers constructeur_telephone, drop phone - Commande app:import-fournisseurs (dry-run par defaut, --force) : non destructive, find-or-create par nom, ne touche jamais un ID existant, ajout-seulement pour telephones/categories - MAJ MCP tools / MachineStructureController / audit subscriber / tests - Frontend : page constructeurs avec telephones multiples + categories (tableau, filtre, formulaire), composable useConstructeurCategories, composant ConstructeurCategorieSelect Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,10 @@ declare(strict_types=1);
|
||||
namespace App\EventSubscriber;
|
||||
|
||||
use App\Entity\Constructeur;
|
||||
use App\Entity\ConstructeurCategorie;
|
||||
use App\Entity\ConstructeurTelephone;
|
||||
use Doctrine\Bundle\DoctrineBundle\Attribute\AsDoctrineListener;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Events;
|
||||
|
||||
#[AsDoctrineListener(event: Events::onFlush)]
|
||||
@@ -23,11 +26,21 @@ final class ConstructeurAuditSubscriber extends AbstractAuditSubscriber
|
||||
|
||||
protected function snapshotEntity(object $entity): array
|
||||
{
|
||||
$telephones = $this->safeGet($entity, 'getTelephones');
|
||||
$categories = $this->safeGet($entity, 'getCategories');
|
||||
|
||||
return [
|
||||
'id' => $entity->getId(),
|
||||
'name' => $this->safeGet($entity, 'getName'),
|
||||
'email' => $this->safeGet($entity, 'getEmail'),
|
||||
'phone' => $this->safeGet($entity, 'getPhone'),
|
||||
'id' => $entity->getId(),
|
||||
'name' => $this->safeGet($entity, 'getName'),
|
||||
'email' => $this->safeGet($entity, 'getEmail'),
|
||||
'telephones' => $telephones instanceof Collection ? array_values(array_map(
|
||||
static fn (ConstructeurTelephone $t): array => ['numero' => $t->getNumero(), 'label' => $t->getLabel()],
|
||||
$telephones->toArray(),
|
||||
)) : [],
|
||||
'categories' => $categories instanceof Collection ? array_values(array_filter(array_map(
|
||||
static fn (ConstructeurCategorie $c): ?string => $c->getName(),
|
||||
$categories->toArray(),
|
||||
))) : [],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user