I get "Class PriceOrQuality \ POQBundle \ Entity \ Tag" is not a valid entity or a superclass matching error. I checked all the answers to similar questions, but I can not understand the problem.
The error is caused by my repository class
<?php
namespace PriceOrQuality\POQBundle\Entity\Repository;
use Doctrine\ORM\EntityRepository as ER;
use PriceOrQuality\POQBundle\Entity\Tag;
use Doctrine\ORM\EntityManager;
class EntityTagsRepository extends ER
{
public function getTagsForTagCloud($entity_ids = null, $tag_id = null) {
$em = $this->getEntityManager();
$qb = $em->createQueryBuilder();
$qb->select(array('IDENTITY(et.tag) as id, COUNT(et.tag) as tag_id_count, LOWER(t.tag) as tag'));
$qb->from('PriceOrQuality\POQBundle\Entity\EntityTag', 'et');
$qb->leftjoin('PriceOrQuality\POQBundle\Entity\Tag','t', 'WITH', 'et.tag = t.id');
$qb->groupBy('et.tag');
$qb->addOrderBy('tag_id_count','DESC');
$qb->setMaxResults(20);
return $qb->getQuery()
->getResult();
}
}
The tag class is defined in this file (Tag.php) (for definition only):
<?php
namespace PriceOrQuality\POQBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use PriceOrQuality\POQBundle\Entity\EntityTag;
use PriceOrQuality\POQBundle\Entity\User;
use JMS\SerializerBundle\Serializer\Serializer;
Do any of you smart guys have any ideas on where to start with debugging?
Thanks in advance,
rune
source
share