在CodeIgniter 3中集成原则 - 实体错误 [英] Integrating Doctrine in CodeIgniter 3 - entity error
问题描述
类User不是一个有效的实体或映射超类
实体User已自动停止,如下所示:
使用Doctrine\ORM\Mapping作为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 = 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文件中禁用,
返回跟踪如下所示:
Backtrace:
档案:
/ var / www / dadgehog / ci / application / third_party / Doctrine / ORM / Mapping / Driver / AnnotationDriver.php
Line:89功能:classIsNotAValidEntityOrMappedSuperClass
文件:
/ var /www/dadgehog/ci/application/third_party/Doctrine/ORM/Mapping/ClassMetadataFactory.php
Line:117功能:loadMetadataForClass
档案:
/var/www/dadgehog/ci/application/third_party/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php
Line:332功能:doLoadMetadata
文件:
/var/www/dadgehog/ci/application/third_party/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php
Line:216功能:loadMetadata
文件:
/var/www/dadgehog/ci/application/third_party/Doctrine/ORM/EntityManager.php
Line:360功能:getMetadataFor
文件:/var/www/dadgehog/ci/application/models/Usermodel.php行:36
功能:find
文件:/var/www/dadgehog/ci/application/controllers/Login.php Line:23
功能:getUser
文件:/ var / www / dadgehog /index.php Line:292功能:require_once
如果任何人有想法指出,我会很高兴。 p>
我为CI3制作了本教程:
im new in Doctrine. Im trying to integrate Doctrine in my CodeIgniter instance but i get an error:
Class "User" is not a valid entity or mapped super class.
The entity User was ceated automatically and looks like this:
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 is disabled in my php.ini file and was loaded.
Doctrine knows the correct path in its config.
The backtrace looks like this:
Backtrace:
File: /var/www/dadgehog/ci/application/third_party/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php Line: 89 Function: classIsNotAValidEntityOrMappedSuperClass
File: /var/www/dadgehog/ci/application/third_party/Doctrine/ORM/Mapping/ClassMetadataFactory.php Line: 117 Function: loadMetadataForClass
File: /var/www/dadgehog/ci/application/third_party/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php Line: 332 Function: doLoadMetadata
File: /var/www/dadgehog/ci/application/third_party/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php Line: 216 Function: loadMetadata
File: /var/www/dadgehog/ci/application/third_party/Doctrine/ORM/EntityManager.php Line: 360 Function: getMetadataFor
File: /var/www/dadgehog/ci/application/models/Usermodel.php Line: 36 Function: find
File: /var/www/dadgehog/ci/application/controllers/Login.php Line: 23 Function: getUser
File: /var/www/dadgehog/index.php Line: 292 Function: require_once
If anyone has an idea to point that out, i would be happy.
The official guide is not complete, and others are for CI2.
I made this tutorial on SO for CI3:
How to install Doctrine in CodeIgniter 3
这篇关于在CodeIgniter 3中集成原则 - 实体错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!