english/administrator/components/com_banners/models/banner.php
/**
	 * Method to stick records.
	 *
	 * @param	array	The ids of the items to publish.
	 * @param	int		The value of the published state
	 *
	 * @return	boolean	True on success.
	 */
Method to stick records.
@param       array   The ids of the items to publish.
@param       int             The value of the published state

@return      boolean True on success.
Method to stick records . @param array The ids of the items to publish . @param int The value of the published state @return boolean True on success .
function stick(&$pks, $value = 1)
	{
		$user	= JFactory::getUser();
		$table	= $this->getTable();
		$pks	= (array) $pks;
		foreach ($pks as $i => $pk) {
			if ($table->load($pk)) {
				if (!$this->canEditState($table)) {
					unset($pks[$i]);
					JError::raiseWarning(403, JText::_('JLIB_APPLICATION_ERROR_EDITSTATE_NOT_PERMITTED'));
				}
			}
		}
		if (!$table->stick($pks, $value, $user->get('id'))) {
			$this->setError($table->getError());
			return false;
		}
		return true;
	}
function stick ( & $ pks , $ value = 1 ) { $ user = JFactory :: getUser ( ) ; $ table = $ this -> getTable ( ) ; $ pks = ( array ) $ pks ; foreach ( $ pks as $ i => $ pk ) { if ( $ table -> load ( $ pk ) ) { if ( ! $ this -> canEditState ( $ table ) ) { unset ( $ pks [ $ i ] ) ; JError :: raiseWarning ( 403 , JText :: _ ( 'JLIB_APPLICATION_ERROR_EDITSTATE_NOT_PERMITTED' ) ) ; } } } if ( ! $ table -> stick ( $ pks , $ value , $ user -> get ( 'id' ) ) ) { $ this -> setError ( $ table -> getError ( ) ) ; return false ; } return true ; }
Method to stick records.
Method to stick records .
// Initialise variables. // Access checks. // Prune items that you can't change. // Attempt to change the state of the records.