0
當我在我的終端上運行此命令symfony的文件已找到,但這個類是不是在它
php app/console doctrine:schema:validate
我得到這個錯誤
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.
我使用symfony的2.8和我的代碼,如示例頁面,所以錯在哪裏?
的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;
}
}
和product.orm.yml文件
AppBundle\Entity\product:
type: entity
table: product
id:
id:
type: integer
generator:
strategy: AUTO