/**
  * @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;
 }
Example #2
0
 /**
  * @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);
 }