Reputation: 75
I try to use Symfony 2.6/Doctrine 2 on Ubuntu 14.04 with php5.5.9/mysql5.5. But i get very strange error and couldn't find any solution.
I create very simple entity with doctrine:generate:entity
command. Everything is just fine. But when I try to create table with doctrine:schema:update
command I get an imposible to fix error :)
[Doctrine\Common\Annotations\AnnotationException]
[Semantical Error] The annotation "@Doctrine\ORM\Mapping\I" in property AppBundle\Entity\Language::$id does not exist, or could not be auto-loaded.
Well, actually it's right. There is nothing such @Doctrine\ORM\Mapping\I
.
It's all about @ORM\Id
. When I change @ORM\Id
, the error also changes. I change it to @ORM\Hello
, the error changes as @Doctrine\ORM\Mapping\Hello
. But when I change it to @ORM\Isthisreal
, the error stand still as @Doctrine\ORM\Mapping\I
.
I thing there is some parsing error about case sensitiveness. But couldn't find any sollution. I tried lots of things but nothing changes. Here is my simple entity:
<?php
namespace AppBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Language
*
* @ORM\Table()
* @ORM\Entity(repositoryClass="AppBundle\Entity\LanguageRepository")
*/
class Language
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var boolean
*
* @ORM\Column(name="is_active", type="boolean")
*/
private $isActive;
/**
* @var string
*
* @ORM\Column(name="iso", type="string", length=2)
*/
private $iso;
/**
* Get id
*
* @return integer
*/
public function getid()
{
return $this->id;
}
/**
* Set isActive
*
* @param boolean $isActive
* @return Language
*/
public function setisActive($isActive)
{
$this->isActive = $isActive;
return $this;
}
/**
* Get isActive
*
* @return boolean
*/
public function getisActive()
{
return $this->isActive;
}
/**
* Set iso
*
* @param string $iso
* @return Language
*/
public function setiso($iso)
{
$this->iso = $iso;
return $this;
}
/**
* Get iso
*
* @return string
*/
public function getiso()
{
return $this->iso;
}
}
Upvotes: 2
Views: 734