english/libraries/joomla/application/component/controllerform.php
/**
	 * Method to check if you can save a new or existing record.
	 *
	 * Extended classes can override this if necessary.
	 *
	 * @param   array   $data  An array of input data.
	 * @param   string  $key   The name of the key for the primary key.
	 *
	 * @return  boolean
	 * @since   11.1
	 */
Method to check if you can save a new or existing record.
Extended classes can override this if necessary.

@param   array   $data  An array of input data.
@param   string  $key   The name of the key for the primary key.


Method to check if you can save a new or existing record . Extended classes can override this if necessary . @param array $data An array of input data . @param string $key The name of the key for the primary key .
protected function allowSave($data, $key = 'id')
	{
		$recordId	= isset($data[$key]) ? $data[$key] : '0';
		if ($recordId) {
			return $this->allowEdit($data, $key);
		} else {
			return $this->allowAdd($data);
		}
	}
protected function allowSave ( $ data , $ key = 'id' ) { $ recordId = isset ( $ data [ $ key ] ) ? $ data [ $ key ] : '0' ; if ( $ recordId ) { return $ this -> allowEdit ( $ data , $ key ) ; } else { return $ this -> allowAdd ( $ data ) ; } }
Method to check if you can save a new or existing record.
Method to check if you can save a new or existing record .
// Initialise variables.