english/administrator/components/com_content/models/article.php
/**
	 * Prepare and sanitise the table data prior to saving.
	 *
	 * @param	JTable	A JTable object.
	 *
	 * @return	void
	 * @since	1.6
	 */
Prepare and sanitise the table data prior to saving.


Prepare and sanitise the table data prior to saving .
protected function prepareTable(&$table)
	{
		if($table->state == 1 && intval($table->publish_up) == 0) {
			$table->publish_up = JFactory::getDate()->toMySQL();
		}
		$table->version++;
		if (empty($table->id)) {
			$table->reorder('catid = '.(int) $table->catid.' AND state >= 0');
		}
	}
protected function prepareTable ( & $ table ) { if ( $ table -> state == 1 && intval ( $ table -> publish_up ) == 0 ) { $ table -> publish_up = JFactory :: getDate ( ) -> toMySQL ( ) ; } $ table -> version ++ ; if ( empty ( $ table -> id ) ) { $ table -> reorder ( 'catid = ' . ( int ) $ table -> catid . ' AND state >= 0' ) ; } }
Prepare and sanitise the table data prior to saving.
Prepare and sanitise the table data prior to saving .
// Set the publish date to now // Increment the content version number. // Reorder the articles within the category so the new article is first