/** * @param \Orm\Zed\Discount\Persistence\SpyDiscount $discountEntity * * @return \Generated\Shared\Transfer\DiscountGeneralTransfer */ protected function hydrateGeneralDiscount(SpyDiscount $discountEntity) { $discountGeneralTransfer = new DiscountGeneralTransfer(); $discountGeneralTransfer->fromArray($discountEntity->toArray(), true); $discountGeneralTransfer->setValidFrom($discountEntity->getValidFrom()); $discountGeneralTransfer->setValidTo($discountEntity->getValidTo()); return $discountGeneralTransfer; }
/** * @param \Orm\Zed\Discount\Persistence\SpyDiscount $discountEntity * * @return string */ protected function createTimePeriod(SpyDiscount $discountEntity) { return $discountEntity->getValidFrom(self::DATE_FORMAT) . ' - ' . $discountEntity->getValidTo(self::DATE_FORMAT); }