Esempio n. 1
0
 /**
  * {@inheritdoc}
  */
 public function wasUsed()
 {
     if ($this->getOutcome() != 'undefined') {
         return true;
     } else {
         return parent::wasUsed();
     }
 }
Esempio n. 2
0
 /**
  * Inherit properties from template
  *
  * @param VIB\FliesBundle\Entity\Vial $template
  */
 protected function inheritFromTemplate(Vial $template = null)
 {
     if (null !== $template) {
         $this->setSetupDate($template->getSetupDate());
         $this->setStoredFlipDate($template->getStoredFlipDate());
         $this->setSize($template->getSize());
         $this->setFood($template->getFood());
         $this->setNotes($template->getNotes());
         $this->setStorageUnit($template->getStorageUnit());
     }
 }
Esempio n. 3
0
 /**
  * {@inheritdoc}
  */
 public function getProgress()
 {
     $parent = $this->getParent();
     if (null !== $parent) {
         return $parent->getProgress();
     }
     return parent::getProgress();
 }
Esempio n. 4
0
 /**
  * {@inheritdoc}
  */
 public function setParent(Vial $parent = null)
 {
     parent::setParent($parent);
     if ($parent instanceof StockVial) {
         $this->setStock($parent->getStock());
     }
 }
Esempio n. 5
0
 /**
  *
  * @param  \VIB\FliesBundle\Entity\Vial               $vial
  * @return \Symfony\Component\HttpFoundation\Response
  */
 private function getVialRedirect(Vial $vial)
 {
     $request = $this->getRequest();
     $route = str_replace("_vial_", "_" . $vial->getType() . "vial_", $request->attributes->get('_route'));
     $url = $this->generateUrl($route, array('id' => $vial->getId()));
     return $this->redirect($url);
 }
Esempio n. 6
0
 public function __construct(Vial $template = null, $flip = true)
 {
     parent::__construct($template, $flip);
     $this->id = 1;
     $this->setSetupDate(new \DateTime('2000-01-01 00:00:00'));
     $maleCross = new CrossVial();
     $virginCross = new CrossVial();
     $this->maleCrosses->add($maleCross);
     $this->virginCrosses->add($virginCross);
 }