11111
2015-02-13 21:08
<?php
namespace Abrasumente\WebBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM|Entity(repositoryClass="UserRepository")
* @ORM|Table(name="user")
*/
class user {
/**
* @ORM|Id
* @ORM|Column(type="integer")
* @ORM|GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM|Column(type="string")
*/
protected $username;
/**
* @ORM|Column(type="string")
*/
protected $password;
}执行
app/console generate:doctrine:entities AbrasumenteWebBundle
后
Generating entities for bundle "AbrasumenteWebBundle" [Doctrine\Common\Annotations\AnnotationException] [Semantical Error] The annotation "@Doctrine\ORM\Mapping" in class Abrasume nte\WebBundle\Entity\user does not exist, or could not be auto-loaded. doctrine:generate:entities [--path="..."] [--no-backup] name
<script>console.log('well!')</script>
<test>
检查了一下.....发现把斜杠写成竖线了, 神坑.
<?php
namespace Abrasumente\WebBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Table(name="users")
* @ORM\Entity()
*/
class User {
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(type="string")
*/
protected $username;
/**
* @ORM\Column(type="string")
*/
protected $password;
}洪大师带你解读Symfony 2框架
20627 学习 · 252 问题
相似问题