I using symfony2 and doctrine and I am getting the following error:
[Semantical Error] The annotation "@Doctrine\ORM\Mapping\RuleId" in property Wibiya\WebsiteBundle\Entity\Rules::$RuleId does not exist, or could not be auto-loaded.
The Rules entity contain the column/field in it.
/**
* @var integer $RuleId
* @ORM\RuleId
* @ORM\Column(name="RuleId", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $RuleId;
This is the function I am trying to run:
$em = $this->getDoctrine()->getEntityManager();
$Rules = $em->getRepository('WibiyaWebsiteBundle:Rules')->findAllOrderedByName();
The RulesRepository class:
public function findAllOrderedByName()
{
return $this->getEntityManager()
->createQuery('SELECT p FROM WibiyaWebsiteBundle:Rules p ORDER BY p.RuleName ASC')
->getResult();
}
I tried to put this line at the bottom of the autoload.php:
require __DIR__ . "/../vendor/doctrine/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php";
But, I got the same error.
I'm using Symfony 2.0.16 and Doctrine 2.1.6