我是 zend 2 和 Doctrine 2 的新手。我尝试创建一个实体类,但收到以下消息:
致命错误:未捕获的异常 'Doctrine\Common\Annotations\AnnotationException' 带有消息 '[Semantical Error] 属性 Workers\Entity\Jobsought::$jobId 中的注释“@Doctrine\ORM\Mapping\jobId”不存在,或者可能不会自动加载
下面是实体类
namespace Workers\Entity;
use Doctrine\ORM\Mapping as ORM;
use Zend\InputFilter\InputFilter;
use Zend\InputFilter\Factory as InputFactory;
use Zend\InputFilter\InputFilterAwareInterface;
use Zend\InputFilter\InputFilterInterface;
/**
*
*
* @ORM\Entity
* @ORM\Table(name="worker_main_jobsort")
* @property int $jobId
*/
class Jobsought implements InputFilterAwareInterface
{
protected $inputFilter;
/**
* @ORM\jobId
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $jobId;
/**
* Magic getter to expose protected properties.
*
* @param string $property
* @return mixed
*/
public function __get($property)
{
return $this->$property;
}
/**
* Magic setter to save protected properties.
*
* @param string $property
* @param mixed $value
*/
public function __set($property, $value)
{
$this->$property = $value;
}
}
任何想法为什么 ORM 不能映射它?该表存在于我的数据库中。