本文介绍了在CodeIgniter 3中集成原则 - 实体错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在教义中的新。我试图集成Doctrine在我的CodeIgniter实例,但我得到一个错误:实体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文件中禁用,
返回跟踪如下所示:
如果任何人有想法指出,我会很高兴。 p>
解决方案
未完成,并且适用于CI2。
我为CI3制作了本教程:
im new in Doctrine. Im trying to integrate Doctrine in my CodeIgniter instance but i get an error:
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:
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中集成原则 - 实体错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!