我是Doctrine的新人。我试图在我的CodeIgniter实例中集成Doctrine,但是我收到一个错误:
类“用户”不是有效实体或映射超类。
实体用户已自动停止,如下所示:
use Doctrine\ORM\Mapping as ORM;
/**
* User
*
* @ORM\Table(name="user")
* @ORM\Entity
*/
class User
{
/**
* @var string
*
* @ORM\Column(name="uid", type="string", length=255, nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $uid;
/**
* @var \DateTime
*
* @ORM\Column(name="cr_date", type="datetime", nullable=false)
*/
private $crDate = 'CURRENT_TIMESTAMP';
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=255, nullable=false)
*/
private $name;
/**
* @var string
*
* @ORM\Column(name="password", type="string", length=255, nullable=false)
*/
eaccelerator在我的php.ini文件中被禁用并被加载。
Doctrine知道其配置中的正确路径。
回溯看起来像这样:
回溯:
文件: /var/www/dadgehog/ci/application/third_party/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php 行:89函数:classIsNotAValidEntityOrMappedSuperClass
文件: /var/www/dadgehog/ci/application/third_party/Doctrine/ORM/Mapping/ClassMetadataFactory.php 行:117函数:loadMetadataForClass
文件: /var/www/dadgehog/ci/application/third_party/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php 行:332功能:doLoadMetadata
文件: /var/www/dadgehog/ci/application/third_party/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php 行:216功能:loadMetadata
文件: /var/www/dadgehog/ci/application/third_party/Doctrine/ORM/EntityManager.php 行:360函数:getMetadataFor
文件:/var/www/dadgehog/ci/application/models/Usermodel.php行:36 功能:找到
文件:/var/www/dadgehog/ci/application/controllers/Login.php行:23 功能:getUser
文件:/var/www/dadgehog/index.php行:292功能:require_once
如果有人有想法指出这一点,我会很高兴。
答案 0 :(得分:1)