english/administrator/components/com_contact/models/contact.php
/**
	 * Method to toggle the featured setting of contacts.
	 *
	 * @param	array	$pks	The ids of the items to toggle.
	 * @param	int		$value	The value to toggle to.
	 *
	 * @return	boolean	True on success.
	 * @since	1.6
	 */
Method to toggle the featured setting of contacts.
@param       array   $pks    The ids of the items to toggle.
@param       int             $value  The value to toggle to.

@return      boolean True on success.
Method to toggle the featured setting of contacts . @param array $pks The ids of the items to toggle . @param int $value The value to toggle to . @return boolean True on success .
public function featured($pks, $value = 0)
	{
		$pks = (array) $pks;
		JArrayHelper::toInteger($pks);
		if (empty($pks)) {
			$this->setError(JText::_('COM_CONTACT_NO_ITEM_SELECTED'));
			return false;
		}
		$table = $this->getTable();
		try
		{
			$db = $this->getDbo();
			$db->setQuery(
				'UPDATE #__contact_details AS a' .
				' SET a.featured = '.(int) $value.
				' WHERE a.id IN ('.implode(',', $pks).')'
			);
			if (!$db->query()) {
				throw new Exception($db->getErrorMsg());
			}
		}
		catch (Exception $e)
		{
			$this->setError($e->getMessage());
			return false;
		}
		$table->reorder();
		$this->cleanCache();
		return true;
	}
public function featured ( $ pks , $ value = 0 ) { $ pks = ( array ) $ pks ; JArrayHelper :: toInteger ( $ pks ) ; if ( empty ( $ pks ) ) { $ this -> setError ( JText :: _ ( 'COM_CONTACT_NO_ITEM_SELECTED' ) ) ; return false ; } $ table = $ this -> getTable ( ) ; try { $ db = $ this -> getDbo ( ) ; $ db -> setQuery ( 'UPDATE #__contact_details AS a' . ' SET a.featured = ' . ( int ) $ value . ' WHERE a.id IN (' . implode ( ',' , $ pks ) . ')' ) ; if ( ! $ db -> query ( ) ) { throw new Exception ( $ db -> getErrorMsg ( ) ) ; } } catch ( Exception $ e ) { $ this -> setError ( $ e -> getMessage ( ) ) ; return false ; } $ table -> reorder ( ) ; $ this -> cleanCache ( ) ; return true ; }
Method to toggle the featured setting of contacts.
Method to toggle the featured setting of contacts .
// Sanitize the ids. // Clean component's cache