public function __construct(Address $address, DTOBuilderFactoryInterface $dtoBuilderFactory) { $this->entity = $address; $this->dtoBuilderFactory = $dtoBuilderFactory; $this->entityDTO = new AddressDTO(); $this->entityDTO->attention = $this->entity->getAttention(); $this->entityDTO->company = $this->entity->getCompany(); $this->entityDTO->address1 = $this->entity->getaddress1(); $this->entityDTO->address2 = $this->entity->getaddress2(); $this->entityDTO->city = $this->entity->getcity(); $this->entityDTO->state = $this->entity->getstate(); $this->entityDTO->zip5 = $this->entity->getzip5(); $this->entityDTO->zip4 = $this->entity->getzip4(); $this->entityDTO->point = $this->dtoBuilderFactory->getPointDTOBuilder($this->entity->getPoint())->build(); }