【发布时间】:2015-11-14 22:11:03
【问题描述】:
我有一个非常原始的问题:
我在我的 Symfony 应用程序中创建了一个实体:
src/AppBundle/Model/Article/Article.php:
<?php
namespace AppBundle\Model\Article;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="articles")
*/
class Article {
/**
* @var integer $id
*
* @ORM\Column(name="id", type="integer", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @var string $name
*
* @ORM\Column(name="name", type="string", length="255", nullable=false)
*/
private $name;
}
当我输入控制台时:
php app/console doctrine:generate:entities AppBundle
打印出来:
Bundle "AppBundle" does not contain any mapped entities.
当我输入时:
php app/console doctrine:generate:entities AppBundle/Model/Article/Article
打印出来:
Class "AppBundle\Model\Article\Article" is not a valid entity or mapped super class.
有人知道如何解决这个问题吗?
我已经在 stackoverflow 上遵循了一些解决方案,例如更改或关闭缓存/清除缓存/等。但没有一个有效。
谢谢和问候!
【问题讨论】:
标签: symfony model doctrine entity schema