Hi,
I've got a model for which I would only like to update one property. I have the unique identifier for the model so know I can simply load the model, make the change, then save it again like so:
<?PHP
$Bill = Bill::findFirst($bill_id);
$Bill->paid = TRUE;
$Bill->save();
However, it seems like a waste to have to do a query to load the model first. So I tried something like this:
<?PHP
// in Bill class, set $this->useDynamicUpdate(true)
$Bill = new Bill();
$Bill->id = $bill_id;
$Bill->paid = TRUE;
$Bill->update();
But it had the same effect.
Basically I don't care what the other properties are, I just want to do the equivalent of this query:
UPDATE
`test`
SET
`paid` = 1
WHERE
`id` = 10348