Skip to content

Instantly share code, notes, and snippets.

@kamil161g
Created May 28, 2019 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kamil161g/6b68207d30406e7fb8cc2cfba82d8f71 to your computer and use it in GitHub Desktop.
Save kamil161g/6b68207d30406e7fb8cc2cfba82d8f71 to your computer and use it in GitHub Desktop.
<?php
namespace App\Service;
use App\Entity\Orders;
use Doctrine\ORM\EntityManagerInterface;
class OrderService
{
/**
* @var EntityManagerInterface
*/
private $entityManager;
public function __construct(EntityManagerInterface $entityManager)
{
$this->entityManager = $entityManager;
}
/**
* @param Orders $orders
* @throws \Doctrine\ORM\ORMException
* @throws \Doctrine\ORM\OptimisticLockException
*/
public function insertFoodToOrder(Orders $orders)
{
return $this->entityManager->getRepository(Orders::class)->insertOrder($orders);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment