【问题标题】:Error genrate crud :CLass XX is not a valid entity or mapped super class错误生成 crud:CLass XX 不是有效实体或映射的超类
【发布时间】:2013-12-27 08:15:50
【问题描述】:

您好,我正在使用 sympfony 2,在创建数据库之后,我希望使用命令(生成 crud)创建我的 crud 但我有这个错误: [学说\ORM\映射\映射异常]
“MyApp\SmfBundle\Entity\Client”类不是有效实体或映射的超级
上课。
我的课是

 namespace MyApp\SmfBundle\Entity;
 use Doctrine\ORM\Mapping as ORM;
 use Symfony\Component\Validator\Constraints as Assert;


/**
* @ORM\Entity
*/

class CLient {
 /**
* @ORM\GeneratedValue
* @ORM\Id
* @ORM\Column(type="integer")
*/
 private $id;
/**
 * @ORM\Column(type="string",length=255)
 * 
 */
private $nom;
/**
 * @ORM\Column(type="string",length=255)
 * 
 */
 private $prnom;

/**
 * @ORM\Column(type="date")
 * 
 */
private $DateNaissance;
public function getId() {
 return $this->id;
 }

public function getNom() {
return $this->nom;
}

public function getPrnom() {
return $this->prnom;
}

public function getDateNaissance() {
return $this->DateNaissance;
}

public function setId($id) {
$this->id = $id;
}

public function setNom($nom) {
  $this->nom = $nom;
}

public function setPrnom($prnom) {
$this->prnom = $prnom;
}

public function setDateNaissance($DateNaissance) {
$this->DateNaissance = $DateNaissance;
}


}

我应该怎么做,谢谢你的帮助

【问题讨论】:

    标签: php symfony doctrine-orm


    【解决方案1】:

    class CLient {

    PHP 区分大小写。您的课程目前称为 CLient。不是客户。

    【讨论】:

      猜你喜欢
      • 2011-11-12
      • 1970-01-01
      • 2013-02-05
      • 2016-09-09
      • 2013-02-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-06
      相关资源
      最近更新 更多