Symfony 如何为相关集合生成get/set函数
我有一些yml配置:Symfony 如何为相关集合生成get/set函数,symfony,doctrine,entity,Symfony,Doctrine,Entity,我有一些yml配置: #Story.orm.yml pv\MyBundle\Entity\Story: type: entity table: story fields: id: id: true type: integer generator: strategy: IDENTITY 及 我想将函数getNews添加到Story,以便执行类似于$Sto
#Story.orm.yml
pv\MyBundle\Entity\Story:
type: entity
table: story
fields:
id:
id: true
type: integer
generator:
strategy: IDENTITY
及
我想将函数getNews
添加到Story
,以便执行类似于$Story\u entity->getNews()的操作
我纠正了一对一的关系:
manyToOne:
story:
targetEntity: Story
inversedBy: news
joinColumn:
name: story_id
referencedColumnName: id
但当我尝试运行命令时
php app/console doctrine:generate:entities --path=src/ MyBundle:Story
symfony不更新News
实体,也不创建函数getNews()
如何生成此函数?也许我犯了一些错误
php app/console doctrine:generate:entities --path=src/ MyBundle:Story