php-idiorm|php-idiorm Primary key ID missing from row or is null

使用idiorm时执行保存操作发现报错
例子:

$data = https://www.it610.com/article/ORM::for_table('tmp_order')->where('oid',$oid)->find_one(); $data->status = 1; $data->save();

查看find_one()源码可知idiorm默认设置表的主键为id,
最后解决方式: 【php-idiorm|php-idiorm Primary key ID missing from row or is null】设置idiorm默认的表主键
ORM::configure('id_column_overrides', array( 'tmp_order' => 'oid' ));

    推荐阅读