/** * {@inheritdoc} */ public function wasUsed() { if ($this->getOutcome() != 'undefined') { return true; } else { return parent::wasUsed(); } }
/** * 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()); } }
/** * {@inheritdoc} */ public function getProgress() { $parent = $this->getParent(); if (null !== $parent) { return $parent->getProgress(); } return parent::getProgress(); }
/** * {@inheritdoc} */ public function setParent(Vial $parent = null) { parent::setParent($parent); if ($parent instanceof StockVial) { $this->setStock($parent->getStock()); } }
/** * * @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); }
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); }