Beispiel #1
0
 /**
  * create
  *
  * @return \POS\Model\Entity\TableInterface
  */
 public function create()
 {
     /** @var \POS\Model\Entity\TableInterface $table */
     $table = parent::create();
     if (!is_null($this->getName())) {
         $table->setName($this->getName());
     }
     $this->getEntityManager()->persist($table);
     $this->getEntityManager()->flush();
     return $table;
 }
Beispiel #2
0
 /**
  * create
  *
  * @return \POS\Model\Entity\CategoryInterface
  */
 public function create()
 {
     /** @var \POS\Model\Entity\CategoryInterface $category */
     $category = parent::create();
     if (!is_null($this->getName())) {
         $category->setName($this->getName());
     }
     $this->getEntityManager()->persist($category);
     $this->getEntityManager()->flush();
     return $category;
 }
Beispiel #3
0
 /**
  * create
  *
  * @return \POS\Model\Entity\ItemInterface
  */
 public function create()
 {
     /** @var \POS\Model\Entity\ItemInterface $item */
     $item = parent::create();
     if (!is_null($this->getCategory())) {
         $item->setCategory($this->getCategory());
     }
     if (!is_null($this->getName())) {
         $item->setName($this->getName());
     }
     if (!is_null($this->getPrice())) {
         $item->setPrice($this->getPrice());
     }
     $this->getEntityManager()->persist($item);
     $this->getEntityManager()->flush();
     return $item;
 }
Beispiel #4
0
 /**
  * create
  *
  * @return \POS\Model\Entity\OrderInterface
  * @throws \Exception
  */
 public function create()
 {
     /** @var \POS\Model\Entity\OrderInterface $order */
     $order = parent::create();
     if (!is_null($this->getTable())) {
         $order->setTable($this->getTable());
     }
     if (!is_null($this->getTime())) {
         $order->setTime($this->getTime());
     }
     if (is_null($order->getStatus())) {
         $order->setStatus(Order::STATE_NEW);
     }
     $this->getEntityManager()->persist($order);
     $this->getEntityManager()->flush();
     return $order;
 }