English 中文(简体)
单一表格
原标题:Single Table Inheritance and Yaml configuration

我想在我的项目中使用单一表格,以图语/教义语,但我找不到任何工作例子。 在正式文件中,只提出了说明组合。 我发现了xml的事例,但我想使用Yaml配置。 有些人能否帮助和分享某些工作守则?

问题回答

奥凯建的转化器挽救生命。

为了节省时间,这个遗产的例子变成了yam:

#file: Resources/config/doctrine/Person.orm.yml
Person:
  type: entity
  table: null
  fields:
    id:
      type: integer
      id: true
      generator:
        strategy: AUTO
  inheritanceType: SINGLE_TABLE
  discriminatorColumn:
    name: discr
    type: string
    length: 255
  discriminatorMap:
    person: Person
    employee: Employee
  lifecycleCallbacks: {  }


#file: Resources/config/doctrine/Employee.orm.yml
Employee:
  type: entity
  table: null
  lifecycleCallbacks: {  }




相关问题
Should I use YAML or JSON to store my Perl data? [closed]

I ve been using the YAML format with reasonable success in the last 6 months or so. However, the pure Perl implementation of the YAML parser is fairly fidgety to hand-write a readable file for and ...

How do you put HTML or XML into a YAML?

I would like to store HTML snippets inside a YAML file. What is the best way to do that? Something like: myhtml: | <div> <a href="#">whatever</a> </div>

What is the difference between YAML and JSON?

What are the differences between YAML and JSON, specifically considering the following things? Performance (encode/decode time) Memory consumption Expression clarity Library availability, ease of use ...

热门标签