english/administrator/components/com_newsfeeds/tables/newsfeed.php
/**
	 * Overriden JTable::store to set modified data and user id.
	 *
	 * @param	boolean	True to update fields even if they are null.
	 * @return	boolean	True on success.
	 * @since	1.6
	 */
Overriden JTable::store to set modified data and user id.
@param       boolean True to update fields even if they are null.
@return      boolean True on success.
Overriden JTable :: store to set modified data and user id . @param boolean True to update fields even if they are null . @return boolean True on success .
public function store($updateNulls = false)
	{
		$date	= JFactory::getDate();
		$user	= JFactory::getUser();
		if ($this->id) {
			$this->modified		= $date->toMySQL();
			$this->modified_by	= $user->get('id');
		} else {
			if (!intval($this->created)) {
				$this->created = $date->toMySQL();
			}
			if (empty($this->created_by)) {
				$this->created_by = $user->get('id');
			}
		}
		$table = JTable::getInstance('Newsfeed', 'NewsfeedsTable');
		if ($table->load(array('alias'=>$this->alias,'catid'=>$this->catid)) && ($table->id != $this->id || $this->id==0)) {
			$this->setError(JText::_('COM_NEWSFEEDS_ERROR_UNIQUE_ALIAS'));
			return false;
		}
		return parent::store($updateNulls);
	}
public function store ( $ updateNulls = false ) { $ date = JFactory :: getDate ( ) ; $ user = JFactory :: getUser ( ) ; if ( $ this -> id ) { $ this -> modified = $ date -> toMySQL ( ) ; $ this -> modified_by = $ user -> get ( 'id' ) ; } else { if ( ! intval ( $ this -> created ) ) { $ this -> created = $ date -> toMySQL ( ) ; } if ( empty ( $ this -> created_by ) ) { $ this -> created_by = $ user -> get ( 'id' ) ; } } $ table = JTable :: getInstance ( 'Newsfeed' , 'NewsfeedsTable' ) ; if ( $ table -> load ( array ( 'alias' => $ this -> alias , 'catid' => $ this -> catid ) ) && ( $ table -> id != $ this -> id || $ this -> id == 0 ) ) { $ this -> setError ( JText :: _ ( 'COM_NEWSFEEDS_ERROR_UNIQUE_ALIAS' ) ) ; return false ; } return parent :: store ( $ updateNulls ) ; }
Overriden JTable::store to set modified data and user id.
Overriden JTable :: store to set modified data and user id .
// Existing item // New newsfeed. A feed created and created_by field can be set by the user, // so we don't touch either of these if they are set. // Verify that the alias is unique