我的实体代码:
GameShelf\GamesBundle\Entity\Game:
type: entity
table: games
id:
id:
type: integer
generator: { strategy: AUTO }
fields:
parent_id:
type: integer
length: 11
name:
type: string
length: 200
slug:
type: string
length: 200
reldate:
type: date
genres:
type: text
platforms:
type: text
developers:
type: text
desc:
type: text
desc_src:
type: text
rate:
string: integer
lenght: 10
Run Code Online (Sandbox Code Playgroud)
我跑了php app/console doctrine:generate:entities GameShelf\GamesBundle\Entity\Game,它回来了Namespace "GameShelf\GamesBundle\Entity\Game" does not contain any mapped entities..怎么了?我跟着这里的文档.
请参阅以下代码以获取Game.orm.yml文件.
GameShelf\GamesBundle\Entity\Game:
type: entity
table: null
fields:
id:
type: integer
id: true
generator:
strategy: AUTO
parent_id:
type: integer
length: 11
name:
type: string
length: 200
slug:
type: string
length: 200
reldate:
type: datetime
genres:
type: text
platforms:
type: text
developers:
type: text
desc:
type: text
desc_src:
type: text
rate:
type: integer
length: 10
Run Code Online (Sandbox Code Playgroud)
以下内容已得到纠正,可能有助于解决您的问题.
在我自己的配置上测试了正确的YAML,并且能够使用以下命令创建实体:
app/console generate:doctrine:entities --no-backup <Your Bundle>
app/console doctrine:schema:update --dump-sql
app/console doctrine:schema:update --force
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7444 次 |
| 最近记录: |