public function __construct(AbstractPayment $payment) { $this->entity = $payment; $this->entityDTO = $this->getEntityDTO(); $this->setId(); $this->setTime(); $this->entityDTO->amount = $this->entity->getAmount(); }