I know how to update a record the 'Joomla way', however of late I have started using a much more neat way which uses J-Cook models.
i,.e here is a little routine that grabs the ID of a newly created record and posts a record into a foreign table (status update)
$updatemodel = CkJModel::getInstance('statusupdate', 'mycomponentModel');
$table = JTable::getInstance('venue', 'mymodelTable');
$newid = $table->getDBO()->insertid(),
$result = $updatemodel ->save(
array(
'venue' => $newid,
'summary' => 'Added the Venue '. $data['name'],
'detail' => 'Why not checkout the latest addition to the platform',
'type' => 'venue',
'link' => 'index.php?option=com_mycomponent&view=deals&Itemid=105&filter_venue='.$newid,
'created_by' => $user->id,
'creation_date' => $creation_date
)
);
what is the EQUIVALENT process for UPDATING a record, not creating a new one.
I.e if I have the ID of the record $data and want to update the longtitude and latitude of the record with $long and $lat (which I have obtained through another process
I assume I will be using
$result = $updatemodel ->update(
but where do I put the 'where' condition?
I know where to put this in the model itself, I just need the syntax