How to convert a model to "model" when its "incomplete"?

I have this

$robots = Robots::findFirst(3);


so far so good, but I dont need all fields, so:

$robots = Robots::findFirst(3, array(

  'columns' => 'id, name'



this time ->save() fails. How to get its "complete" object?

Post fixed. Please read the Markdown FAQ for properly formatting code.


Is it failing your validation? What is the error?

edited Oct '15

You could try turning on 'useDynamicUpdate' - with the model.

Although I'm not quite sure the actual model class is returned when you specify columns, but rather an object representing the partial database object.

var_dump(get_class(Robots::findFirst(3, ['columns' => 'id, name']));
//If it returns the Model class, then try useDynamicUpdate() - otherwise you'd probably need to do PHQL to update the table.