'lot_code', 'NO_OPA' => 'opa_code', 'NO_ELEV' => 'inuav_code', 'LOTABA' => 'abatage_code', 'DATABA' => 'abatage_date', 'CODE_TRACA_PROD_ELAB' => 'produit_elab' ]; /** * Les données sont encapsulés dans le xml * * @var boolean */ protected $encapsulate = true; /** * Les champs qui peuvents être null * * @var array */ protected $nullableFields = [ 'opa_code', 'inuav_code', 'abatage_code', 'abatage_date' ]; /** * La clé unique pour la table * * @var array */ protected $uniqueKeyField = ['lot_code']; /** * Execute the job. * * @return void */ public function handle() { $this->parseData( 'ENRLOT', XmlTraceability::class, // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed function (\SimpleXMLElement $xmlContent, array &$line) { $abatage_date = \explode('.', $line['abatage_date']); // * Inverser année et jours a cause du flux $line['abatage_date'] = \sprintf( '20%s/%s/%s', $abatage_date[2], $abatage_date[1], $abatage_date[0] ); } ); } }