I did not understand the need to define the class in the mapping and
not in the entity class. I am French, I am mistaken in translating the
documentation (ok it is a hoax:))

So I added in my file xxx.dcm.xml this option:
<entity name="Application\HelloBundle\Entity\Categorie" repository-
class="Application\HelloBundle\Entity\CategorieRepository">

And control doctrine: generate: repositories works well!

it can be used to other ...

On 18 sep, 18:28, Richard D Shank <deve...@zestic.com> wrote:
> Try capitalizing @entity (@Entity)
>
> On 09/18/2010 08:41 AM, spike3111 wrote:
>
> > I try to set up a simple custom repository, looking at the
> > documentation doctrine2. I first tried the command
> > doctrine:generate:repositories, which does not make mistakes, but that
> > does not work either. So I created a class Entity
> > CustomCategorieRepository
>
> > <?php
> > namespace Application\HelloBundle\Entity;
>
> > use Doctrine\ORM\EntityRepository;
>
> > class CustomCategorieRepository extends EntityRepository
> > {
> >      public function getAllCategorie()
> >      {
> >          return $this->_em->createQuery('SELECT u FROM Application
> > \HelloBundle\Entity\Categorie u LEFT JOIN u.articles a')
> >                  ->getResult();
> >      }
> > }
>
> > And in my entity I added annotation @entity:
> > <?php
>
> > namespace Application\HelloBundle\Entity;
>
> > /**
> >   * Application\HelloBundle\Entity\Categorie
> >   * @entity(repositoryClass="Application\HelloBundle\Entity
> > \CustomCategorieRepository")
> >   */
> > class Categorie
> > {
>
> > I get an error on the fact that my custom repository is not taken into
> > account.
>
>

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to