for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace GGGGino\SkuskuCartBundle\Repository;
use GGGGino\SkuskuCartBundle\Model\SkuskuCart;
use GGGGino\SkuskuCartBundle\Model\SkuskuCustomerInterface;
/**
* CartRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class CartRepository extends \Doctrine\ORM\EntityRepository
{
* Prendo tutti i carrelli attivi non eliminati
public function getNonOrderedCarts()
$qb = $this->createQueryBuilder('c')
->andWhere('c.status = :status')
->setParameter('status', SkuskuCart::STATUS_INITIAL)
->getQuery();
return $qb->execute();
}
public function getOneNonOrderedCartByCustomer(SkuskuCustomerInterface $customer)
->where('c.status = :status')
->andWhere('c.customer = :customer')
->setParameter('customer', $customer)
->setMaxResults(1)
return $qb->getOneOrNullResult();