当我试图从控制台创建权利时,我给出了这个错误:
命名空间"..."不包含任何映射实体
所以,
这是我的代码
哪一行有误,请告诉我.谢谢.
namespace SfTuts\JobeetBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="job")
*/
class Job
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
protected $id;
/**
* @ORM\ManyToOne(targetEntity="Category")
* @ORM\JoinColumn(name="category_id", referencedColumnName="id")
*/
protected $category;
/**
* @ORM\Column(type="string", length=255)
*/
protected $type;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
protected $company;
/**
* @ORM\Column(type="string", length=255)
*/
protected $logo;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
protected $url;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
protected $position;
/**
* @ORM\Column(type="string", length=255)
*/
protected $location;
/**
* @ORM\Column(type="string", length=4000)
*/
protected $description;
/**
* @ORM\Column(type="string", length=4000, name="how_to_apply")
*/
protected $howToApply;
/**
* @ORM\Column(type="string", length=255, unique=true)
*/
protected $token;
/**
* @ORM\Column(type="boolean", name="is_public")
*/
protected $isPublic;
/**
* @ORM\Column(type="boolean", name="is_activated")
*/
protected $isActivated;
/**
* @ORM\Column(type="string", length=255)
*/
protected $email;
/**
* @ORM\Column(type="datetime", name="created_at")
*/
protected $createdAt;
/**
* @ORM\Column(type="datetime", name="updated_at")
*/
protected $updatedAt;
/**
* @ORM\Column(type="datetime", name="expires_at")
*/
protected $expiresAt;
public function __construct()
{
$this->createdAt = new \DateTime();
$this->updatedAt = new \DateTime();
}
}
Run Code Online (Sandbox Code Playgroud)
我怎么能解决这个问题.谢谢.
使用
doctrine:generate:entity
Run Code Online (Sandbox Code Playgroud)
创建新实体.
然后通过编辑文件添加自己的属性后,使用
doctrine:generate:entities AcmeDemoBundle:MyEntity
Run Code Online (Sandbox Code Playgroud)
创建getter/setter
| 归档时间: |
|
| 查看次数: |
8180 次 |
| 最近记录: |