SyncContactsCommand
extends Command
in package
Synchronise le carnet de contacts avec les cartes de visite (`BusinessCardAize`) créées récemment.
Commande : php bin/console app:sync:contacts. Options : --hours (nombre d'heures à
regarder en arrière, 24 par défaut) et --dry-run (n'écrit rien en base, se contente
d'afficher ce qui aurait été synchronisé). Aucun argument obligatoire.
Recherche les BusinessCardAize dont createdAt est postérieur à la fenêtre demandée, puis
délègue chacune à BCardContactSyncService::syncContactWithBCard(). Effets de bord : en
l'absence de --dry-run, un flush() de l'EntityManager persiste les contacts
synchronisés ; les erreurs par carte sont capturées individuellement et n'interrompent pas le
traitement des suivantes.
Attributes
- #[AsCommand]
- $name: 'app:sync:contacts'
- $description: 'Synchronise les contacts à partir des BusinessCard récentes'
Table of Contents
Properties
- $contactSyncService : BCardContactSyncService
- $entityManager : EntityManagerInterface
Methods
- __construct() : mixed
- configure() : void
- execute() : int
Properties
$contactSyncService
private
BCardContactSyncService
$contactSyncService
$entityManager
private
EntityManagerInterface
$entityManager
Methods
__construct()
public
__construct(EntityManagerInterface $entityManager, BCardContactSyncService $contactSyncService) : mixed
Parameters
- $entityManager : EntityManagerInterface
- $contactSyncService : BCardContactSyncService
configure()
protected
configure() : void
execute()
protected
execute(InputInterface $input, OutputInterface $output) : int
Parameters
- $input : InputInterface
- $output : OutputInterface