Skip to content

Instantly share code, notes, and snippets.

@umpirsky
Created March 26, 2013 13:00
Show Gist options
  • Save umpirsky/5245174 to your computer and use it in GitHub Desktop.
Save umpirsky/5245174 to your computer and use it in GitHub Desktop.
<?php
namespace Sylius\Bundle\CartBundle\Entity;
use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository;
class CartRepository extends EntityRepository
{
protected function getQueryBuilder()
{
return parent::getQueryBuilder()
->select('cart, item')
->leftJoin('cart.items', 'item')
;
}
protected function getAlias()
{
return 'cart';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment