[英]symfony The file was found but the class was not in it
when I run this command on my terminal 当我在终端上运行此命令时
php app/console doctrine:schema:validate
I get this error 我得到这个错误
The autoloader expected class "tuto\testBundle\Entity\product" to be defined in file "../src/tuto/testBundle/Entity/product.php". The file was found but the class was not in it, the class name or names
pace probably has a typo.
I using symfony 2.8 and my code like the example page so what's the wrong ? 我使用symfony 2.8和类似示例页面的代码,这是怎么回事?
the product.php file code product.php文件代码
<?php
namespace AppBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="product")
*/
class product
{
/**
*@ORM\Column(type="integer")
*@ORM\Id
*@ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/** @ORM\Column(length=140) */
public function getUserId(){
return $this->UserId;
}
public function setUserId($id){
return $this->UserId=$id;
}
}
and the product.orm.yml file 和product.orm.yml文件
AppBundle\Entity\product:
type: entity
table: product
id:
id:
type: integer
generator:
strategy: AUTO
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.