ttgive / qeephp

Automatically exported from code.google.com/p/qeephp
0 stars 0 forks source link

完善 QDB_ActiveRecord_Abstract::save() #35

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
该方法的逻辑根据关联类型的不同稍有区别。

belongs to 
关联的对象始终不自动保存,其他类型的关联对象则根据 
on_save 设置
来决定。

$use_transaction 参数指定是否使用事务。

Original issue reported on code.google.com by dualf...@gmail.com on 18 Apr 2008 at 7:13

GoogleCodeExporter commented 9 years ago

Original comment by dualf...@gmail.com on 18 Apr 2008 at 7:18

GoogleCodeExporter commented 9 years ago

Original comment by dualf...@gmail.com on 19 Apr 2008 at 8:28

GoogleCodeExporter commented 9 years ago
$force_create 参数改为了 $save_method。

这样可以在保存时指定保存方法,默认为“save”。可用值有 
create、update、replace 和 save。

save 表示根据主键字段是否有值来决定是保存还是创建;
create 表示始终尝试创建
update 表示始终尝试更新
replace 表示尝试替换已有数据,如果不存在则创建

Original comment by dualf...@gmail.com on 2 May 2008 at 5:31

GoogleCodeExporter commented 9 years ago

Original comment by dualf...@gmail.com on 3 May 2008 at 3:19