/** * This method runs before the $data is saved to the $table. Return false to * stop saving. * * @param array &$data Param * @param JTable &$table Param * * @return bool */ protected function onBeforeSave(&$data, &$table) { EForm::onBeforeSaveWithParams($data); return parent::onBeforeSave($data, $table); }
/** * This method runs before the $data is saved to the $table. Return false to * stop saving. * * @param array &$data Param * @param JTable &$table Param * * @return bool */ protected function onBeforeSave(&$data, &$table) { jimport('extly.form.eform'); EForm::onBeforeSaveWithParams($data); return parent::onBeforeSave($data, $table); }
/** * This method runs before the $data is saved to the $table. Return false to * stop saving. * * @param array &$data Param * @param JTable &$table Param * * @return bool */ protected function onBeforeSave(&$data, &$table) { // Check for unique frontendchannel / channeltype if ($data['xtform']['frontendchannel']) { $channel = F0FModel::getTmpInstance('Channels', 'AutotweetModel'); $channel->setState('frontendchannel', 1); $channel->setState('channeltype', $data['channeltype_id']); $frontChannels = $channel->getItemList(true); if (count($frontChannels) > 0 && $frontChannels[0]->id != $data['id']) { $this->setError(JText::_('COM_AUTOTWEET_CHANNEL_ERR_ALREADY_FRONTENDCHANNELTYPE')); return false; } } EForm::onBeforeSaveWithParams($data); return parent::onBeforeSave($data, $table); }