示例#1
0
 /**
  * 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);
 }
示例#2
0
文件: template.php 项目: Rikisha/proj
 /**
  * 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);
 }