english/administrator/components/com_banners/tables/banner.php
/**
	 * Overloaded bind function
	 *
	 * @param	array		$hash named array
	 * @return	null|string	null is operation was satisfactory, otherwise returns an error
	 * @see JTable:bind
	 * @since 1.5
	 */
Overloaded bind function
@param       array           $hash named array
@return      null|string     null is operation was satisfactory, otherwise returns an error
@see JTable:bind
@since 1.5
Overloaded bind function @param array $hash named array @return null|string null is operation was satisfactory otherwise returns an error @see JTable : bind @since 1 . 5
public function bind($array, $ignore = array())
	{
		if (isset($array['params']) && is_array($array['params'])) {
			$registry = new JRegistry();
			$registry->loadArray($array['params']);
			if((int) $registry->get('width', 0) < 0){
				$this->setError(JText::sprintf('JLIB_DATABASE_ERROR_NEGATIVE_NOT_PERMITTED', JText::_('COM_BANNERS_FIELD_WIDTH_LABEL')));
				return false;
			}
			if((int) $registry->get('height', 0) < 0){
				$this->setError(JText::sprintf('JLIB_DATABASE_ERROR_NEGATIVE_NOT_PERMITTED', JText::_('COM_BANNERS_FIELD_HEIGHT_LABEL')));
				return false;
			}
			$width = abs((int) $registry->get('width', 0));
			$height = abs((int) $registry->get('height', 0));
			$registry->set('width', ($width ? $width : ''));
			$registry->set('height', ($height ? $height : ''));
			$array['params'] = (string)$registry;
		}
		if (isset($array['imptotal'])) {
			$array['imptotal'] = abs((int) $array['imptotal']);
		}
		return parent::bind($array, $ignore);
	}
public function bind ( $ array , $ ignore = array ( ) ) { if ( isset ( $ array [ 'params' ] ) && is_array ( $ array [ 'params' ] ) ) { $ registry = new JRegistry ( ) ; $ registry -> loadArray ( $ array [ 'params' ] ) ; if ( ( int ) $ registry -> get ( 'width' , 0 ) < 0 ) { $ this -> setError ( JText :: sprintf ( 'JLIB_DATABASE_ERROR_NEGATIVE_NOT_PERMITTED' , JText :: _ ( 'COM_BANNERS_FIELD_WIDTH_LABEL' ) ) ) ; return false ; } if ( ( int ) $ registry -> get ( 'height' , 0 ) < 0 ) { $ this -> setError ( JText :: sprintf ( 'JLIB_DATABASE_ERROR_NEGATIVE_NOT_PERMITTED' , JText :: _ ( 'COM_BANNERS_FIELD_HEIGHT_LABEL' ) ) ) ; return false ; } $ width = abs ( ( int ) $ registry -> get ( 'width' , 0 ) ) ; $ height = abs ( ( int ) $ registry -> get ( 'height' , 0 ) ) ; $ registry -> set ( 'width' , ( $ width ? $ width : '' ) ) ; $ registry -> set ( 'height' , ( $ height ? $ height : '' ) ) ; $ array [ 'params' ] = ( string ) $ registry ; } if ( isset ( $ array [ 'imptotal' ] ) ) { $ array [ 'imptotal' ] = abs ( ( int ) $ array [ 'imptotal' ] ) ; } return parent :: bind ( $ array , $ ignore ) ; }
Overloaded bind function
 @param       array           $hash named array
 @return      null|string     null is operation was satisfactory, otherwise returns an error
 @see JTable:bind
 @since 1.5
Overloaded bind function @param array $hash named array @return null|string null is operation was satisfactory otherwise returns an error @see JTable : bind @since 1 . 5
// Converts the width and height to an absolute numeric value: // Sets the width and height to an empty string if = 0