Articles module example

edited May 2011 in Modules
Following the articles module example. I have categories that are related to products.

I am unable to save. I keep getting the same error.

Fatal error: Call to undefined method stdClass::save() in /localhost/ver2/fuel/application/core/MY_Model.php on line 1102

function on_after_save($values)
$data = (!empty($this->normalized_save_data['categories'])) ? $this->normalized_save_data['categories'] : array();
$this->save_related('categories_to_products_model', array('product_id' => $values['id']), array('category_id' => $data));

Any help would be appreciated thanks!


  • edited 11:19PM
    Is your record class named correctly? I ask because it says stdClass instead of a Data_record class and stdClass won't have that method.
  • edited 11:19PM
    Sweet that did the trick. had product as plural when it needed to be singular. Thanks!
Sign In or Register to comment.