I tried to use this method for something I coded recently, but the save it just not firing at all.
If I take a vanilla save process... i.e
public function save($data)
{
if (parent::save($data)) {
return true;
}
return false;
}
Logically I would put the extra model code before the return true; statement
i.e
public function save($data)
{
if (parent::save($data)) {
// Put code here
return true;
}
return false;
}
But nothing happens (currently I am using the traditional Joomla database query in this spot and it works fine, but your method looks sooooo much sweeter)
My attempt is
public function save($data)
{
if (parent::save($data)) {
$bemodel = CkJModel::getInstance('changelog', 'MycomponentModel');
$result = $bemodel ->save(
array(
'genre' => $data['id'],
'notes' => 'Genre updated'
)
);
return true;
}
return false;
}