本文介绍了在CodeIgniter 3中集成原则3 - 实体错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

新教在新教。我试图在我的CodeIgniter实例中集成Doctrine,但是我收到一个错误:

实体用户自动完成,如下所示:

 使用Doctrine\ORM\Mapping作为ORM; 

/ **
*用户
*
* @ 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文件中被禁用,



Doctrine知道其配置中的正确路径。



回溯如下所示: p>

如果有人有一个想法指出,我会很开心。 p>

解决方案

尚未完成,而用于CI2。



我将本教程用于SO3为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中集成原则3 - 实体错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-26 08:04