The annotation "@Doctrine\ORM\Mapping\Idblogad" in property Blog\Entity\Blogad::$idblogad does not exist, or could not be auto-loaded

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

The annotation "@Doctrine\ORM\Mapping\Idblogad" in property Blog\Entity\Blogad::$idblogad does not exist, or could not be auto-loaded

dinispt
hi


i am using doctrine with zend framework 2.3.0

my database table as an id called idblogad, pk and auto

i am following the album example

this its the entity :

* @ORM\Entity
* @ORM\Table(name="blogad")
* @property int $idblogad
* @property string $titulo
* @property string $texto
* @property int $identidade
*/
class Blogad implements InputFilterAwareInterface
{
protected $inputFilter;
 

the problem its here :
with the album we have * @ORM\Id
but my table does not have id but has idblogad

/**
* @ORM\idblogad
* @ORM\Column(type="integer");
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $idblogad;

this is the the complete error :

( ! ) Fatal error: Uncaught exception 'Doctrine\Common\Annotations\AnnotationException' with message '[Semantical Error] The annotation "@Doctrine\ORM\Mapping\Idblogad" in property Blog\Entity\Blogad::$idblogad does not exist, or could not be auto-loaded.' in C:\websites\dinispt\vendor\doctrine\annotations\lib\Doctrine\Common\Annotations\AnnotationException.php on line 54
( ! ) Doctrine\Common\Annotations\AnnotationException: [Semantical Error] The annotation "@Doctrine\ORM\Mapping\Idblogad" in property Blog\Entity\Blogad::$idblogad does not exist, or could not be auto-loaded. in C:\websites\dinispt\vendor\doctrine\annotations\lib\Doctrine\Common\Annotations\AnnotationException.php on line 54


thanks
Reply | Threaded
Open this post in threaded view
|

Re: The annotation "@Doctrine\ORM\Mapping\Idblogad" in property Blog\Entity\Blogad::$idblogad does not exist, or could not be auto-loaded

Alejandro Celaya
Hi.

The ORM\Id annotation is used to define which is the id field, even if it
is not called id.
The annotations are existing classes so you can't use the name you want.

Just use ORM\Id instead of ORM\idblogad and it should work.

Best regards.

--
Alejandro Celaya AlastruƩ
www.alejandrocelaya.com
El 26/06/2014 21:20, "dinispt" <[hidden email]> escribiĆ³:

> hi
>
>
> i am using doctrine with zend framework 2.3.0
>
> my database table as an id called idblogad, pk and auto
>
> i am following the album example
>
> this its the entity :
>
> * @ORM\Entity
> * @ORM\Table(name="blogad")
> * @property int $idblogad
> * @property string $titulo
> * @property string $texto
> * @property int $identidade
> */
> class Blogad implements InputFilterAwareInterface
> {
> protected $inputFilter;
>
>
> the problem its here :
> with the album we have * @ORM\Id
> but my table does not have id but has idblogad
>
> /**
> * @ORM\idblogad
> * @ORM\Column(type="integer");
> * @ORM\GeneratedValue(strategy="AUTO")
> */
> protected $idblogad;
>
> this is the the complete error :
>
> ( ! ) Fatal error: Uncaught exception
> 'Doctrine\Common\Annotations\AnnotationException' with message '[Semantical
> Error] The annotation "@Doctrine\ORM\Mapping\Idblogad" in property
> Blog\Entity\Blogad::$idblogad does not exist, or could not be auto-loaded.'
> in
>
> C:\websites\dinispt\vendor\doctrine\annotations\lib\Doctrine\Common\Annotations\AnnotationException.php
> on line 54
> ( ! ) Doctrine\Common\Annotations\AnnotationException: [Semantical Error]
> The annotation "@Doctrine\ORM\Mapping\Idblogad" in property
> Blog\Entity\Blogad::$idblogad does not exist, or could not be auto-loaded.
> in
>
> C:\websites\dinispt\vendor\doctrine\annotations\lib\Doctrine\Common\Annotations\AnnotationException.php
> on line 54
>
>
> thanks
>
>
>
> --
> View this message in context:
> http://zend-framework-community.634137.n4.nabble.com/The-annotation-Doctrine-ORM-Mapping-Idblogad-in-property-Blog-Entity-Blogad-idblogad-does-not-exist-d-tp4662178.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
> --
> List: [hidden email]
> Info: http://framework.zend.com/archives
> Unsubscribe: [hidden email]
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: The annotation "@Doctrine\ORM\Mapping\Idblogad" in property Blog\Entity\Blogad::$idblogad does not exist, or could not be auto-loaded

dinispt
thanks
obrigado