gpt4 book ai didi

symfony1 - embedRelation()(sfPropel15Plugin)是否适用于多对多关系?

转载 作者:行者123 更新时间:2023-12-03 22:28:55 26 4
gpt4 key购买 nike

embedRelation()(sfPropel15Plugin)是否适用于多对多
关系?如果没有任何经验或教程可以获取(嵌入
m:m关系的表格)?

问候

哈维

最佳答案

schema.yml

product:
id: ~
name: {type: varchar(255), required: true}
price: {type: integer, required: true}

order_list:
id: ~
order_id: {type: integer, required: true, foreignTable: order, foreignReference: id, onDelete: cascade, onUpdate: cascade}
product_id: {type: integer, required: true, foreignTable: product, foreignReference: id, onDelete: cascade, onUpdate: cascade}

order:
id: ~
name: {type: varchar(255), required: true}


类形式:

class OrderForm extends BaseOrderForm
{
public function configure()
{
$this->embedRelation('OrderList');
}
}


添加如下所示:

关于symfony1 - embedRelation()(sfPropel15Plugin)是否适用于多对多关系?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4727060/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com