Beispiel #1
0
 /**
  * @param Order $order
  * @return null|Advertisment
  */
 public function activateAdditionalFeatures(Order $order)
 {
     $now = new \DateTime();
     if ($order !== null) {
         if ($order->getAdvOnMain() === true) {
             $this->setOnMainUntill($now->modify('+' . $order->getAdvOnMainPeriod() . ' days'));
         }
         if ($order->getAdvOnTop() === true) {
             $this->setOnTopUntill($now->modify('+' . $order->getAdvOnTopPeriod() . ' days'));
         }
         if ($order->getAdvFilled() === true) {
             $this->setFilledUntill($now->modify('+' . $order->getAdvFilledPeriod() . ' days'));
         }
         if ($order->getAdvUrgent() === true) {
             $this->setUrgentUntill($now->modify('+' . $order->getAdvUrgentPeriod() . ' days'));
         }
         if ($order->getAdvUpdate() === true) {
             $this->setDate($now);
         }
         if ($order->getAdvBlock() === true) {
             $this->setOnBlockUntill($now->modify('+' . $order->getAdvBlockPeriod() . ' days'));
         }
         return $this;
     } else {
         return null;
     }
 }