public function __construct(CartPriceRule $cartPriceRule, DTOBuilderFactoryInterface $dtoBuilderFactory) { $this->entity = $cartPriceRule; $this->dtoBuilderFactory = $dtoBuilderFactory; $this->entityDTO = $this->getEntityDTO(); $this->setId(); $this->setTime(); $this->setStartEndDate(); $this->setRedemption(); $this->entityDTO->name = $this->entity->getName(); $this->entityDTO->reducesTaxSubtotal = $this->entity->getReducesTaxSubtotal(); $this->entityDTO->isRedemptionCountValid = $this->entity->isRedemptionCountValid(); }