model in readonly mode

edited January 2015 in Bug Reports
I have a library which is loading a model and then calling the delete function on the model and I run into the 'model is in readonly mode and can't modify data' exception. I don't have anywhere in my code where I'm making the model readonly. Is this a symptom of some other issue? I can get around it by setting the readonly property of the model after I load it in my library but not by setting the default value in the model itself - regardless I'd rather not have to explicitly set the property every time if at all possible. Is this something someone else has run into before?

Comments

  • edited 9:52AM
    The default readonly value for a MY_Model should be FALSE. However, if you use the fuel_model() function it sets the readonly value to TRUE. You can get around this by not using the fuel_model function and loading the model like you would normally in CI:
    $CI->load->model('my_model'); $record = $CI->my_model->find_one(array('id' => 1));
Sign In or Register to comment.