public function update($data, $rows = null) { // we didn't get the id of the log item, so we find it ourselves if (!$rows) { $params = array('iso_code' => $data['iso_code'], 'table_name' => $data['table_name'], 'row_id' => $data['row_id']); $rows = (array) $this->findByConditions($params)->nooku_node_id; } return parent::update($data, $rows); }
/** * Update the rows, and change the #__isocode_tables and nodes isocodes when necessary * * @param array An associative array of data to be updated * @param mixed Can either be a row, an array of rows or a query object * @return boolean True if successful otherwise returns false */ public function update($data, $where = null) { $nooku = KFactory::get('admin::com.nooku.model.nooku'); // Check if the new data contains an iso_code if (isset($data['iso_code'])) { $new_iso = $data['iso_code']; $primary = $nooku->getPrimaryLanguage()->iso_code; settype($where, 'array'); // Update #__isocode_tables names if necessary foreach ($where as $id) { $old_iso = $this->find($id)->get('iso_code'); if ($new_iso != $old_iso) { if ($primary != $old_iso) { // don't rename the primary lang tables, they dont have an iso in there name $this->_renameIsoTable($old_iso, $new_iso); } $this->_renameIsoNodes($old_iso, $new_iso); } } } return parent::update($data, $where); }