identification; $summary->countryCode = $identification?->bovin?->countryCode; $summary->nationalNumber = $identification?->bovin?->nationalNumber; $summary->sex = $identification?->sex; $summary->breedType = $identification?->breedType; $summary->workNumber = $identification?->workNumber; $summary->birthDate = $identification?->birthDate?->date?->format('Y-m-d'); $summary->birthDateCompletenessFlag = $identification?->birthDate?->completenessFlag; $summary->isFilie = $identification?->isFilie; $summary->motherNationalNumber = $identification?->motherCarrier?->bovin?->nationalNumber; $summary->motherBreedType = $identification?->motherCarrier?->breedType; $summary->fatherNationalNumber = $identification?->fatherIpg?->bovin?->nationalNumber; $summary->fatherBreedType = $identification?->fatherIpg?->breedType; $summary->birthExploitationNumber = $identification?->birthExploitation?->exploitationNumber; foreach ($dto->presencePeriods as $presencePeriodDto) { $presencePeriod = new PresencePeriod(); $presencePeriod->entryDate = $presencePeriodDto->entry?->date?->format('Y-m-d'); $presencePeriod->entryCause = $presencePeriodDto->entry?->cause; $presencePeriod->exitDate = $presencePeriodDto->exit?->date?->format('Y-m-d'); $presencePeriod->exitCause = $presencePeriodDto->exit?->cause; $summary->presencePeriods[] = $presencePeriod; } return $summary; } }