FuelPHP ORM Update via Array

The ORM in FuelPHP has an update example that looks like this:

$entry = Model_Article::find(4);
$entry->title = 'My first edit';
$entry->author = 'Total n00b';
$entry->save();

I'm wondering if there is an ability for me to update w/ something like this:

$values = array(
     'this' => $that
);

Model_Article::find(4)->save($values);

The insert ability allows for passing arrays of values:

$props = array('property' => 'something');

$new = Model_Example::forge($props)->save();

But I see no example of doing the same thing w/ the update ability.

EDIT: It appears Model_Example::find(4)->values($array)->save(); is what I'm looking for.


It appears Model_Example::find(4)->values($array)->save(); is what I'm looking for.

链接地址: http://www.djcxy.com/p/64800.html

上一篇: 我应该尝试摆脱我的MySQL数据库的背面

下一篇: FuelPHP ORM通过数组更新