0

私のバックエンドには顧客を作成するためのフォームがありますが、この顧客に少し説明を割り当てる必要があります。

これで、2つのフォームができました。1つは顧客に関する情報を作成および変更するフォームで、もう1つはこの顧客に割り当てられた説明行を追加または変更できるフォームです。可能であれば、お客様のデータとお客様の説明のデータを作成・変更したいと思います。

フォームを作成してデフォルト値を変更する方法は知っていますが、モデルの2つのフォームを1対多の関係で統合する方法がわかりません。

私のスキーマ:

InfoClient:
  tableName: info_client
  columns:
    id:
      type: integer(4)
      fixed: false
      unsigned: false
      primary: true
      autoincrement: true 
    info_client_type_id:
      type: integer(4)
      notnull: true
    name_info_client: 
      type: string(255)
      notnull: true
      unique: true

  relations:
    InfoClientLine:
      type: many
      local: id
      foreign: info_client_id

InfoClientLine:
  tableName: info_client_line
  columns:
    id:
      type: integer(4)
      fixed: false
      unsigned: false
      primary: true
      autoincrement: true 
    info_client_id:
      type: integer(4)
    texto:
      type: string()
    info_client_line_type_id:
      type: integer(4)
      notnull: true

symfony用に作成されたデフォルトの設定ファイルを使用します。そして、デフォルトのモデルはsymfony用に作成します。

4

1 に答える 1

2

ケースに関する公式ドキュメントに素晴らしい例があります。この種の形式の製品の多くの写真:

ここに画像の説明を入力してください

あなたのために:

  • Product->InfoClient
  • Photo->InfoClientLine
于 2012-07-17T11:23:03.343 に答える