/
var
/
www
/
html
/
restaurants
/
src
/
Repository
/
Upload File
HOME
<?php namespace App\Repository; /** * SupplyRepository * * This class was generated by the Doctrine ORM. Add your own custom * repository methods below. */ class SupplyRepository extends \Doctrine\ORM\EntityRepository { /** * Delete Supply items belonging to a supply * @param int $id Supply ID * @param int $user User ID */ public function deleteSuppliesBySupplier($id, $user) { return $this->getEntityManager() ->createQuery( 'DELETE FROM App\Entity\Supply s WHERE s.supplier = :id AND s.userId = :user' )->setParameter('id', $id) ->setParameter('user', $user) ->getResult(); } }