/** * Pre-save processing. * Convert 'data' to json. Encode password. * * @param array $src - array of data * @param type $orderingFilter * @param type $ignore * @return boolean */ public function store($updateNulls = false) { if (!empty($this->data) && !is_string($this->data)) { $this->data = json_encode($this->data); } if (!empty($this->password)) { $this->password = base64_encode($this->password); } return parent::store($updateNulls = false); }
/** * Overriden JTable::store to set created/modified and user id. * * @param boolean True to update fields even if they are null. * * @return boolean True on success. * @since 1.0 */ public function store($updateNulls = false) { $date = JFactory::getDate(); $user = JFactory::getUser(); // Verify that the alias is unique $table = JTable::getInstance('Template', 'NewsletterTable'); if (isset($this->name)) { if ($table->load(array('name' => $this->name))) { $this->setError(JText::_('COM_NEWSLETTER_DATABASE_ERROR_SUBSCRIBER_UNIQUE_NAME')); return false; } } return parent::store($updateNulls); }