public static function ToInt( $value, $provider = null )
	{
		if ( $value instanceof ValueProxy )
		{
			return $value->ToInt( $provider );
		}

		if ( $value instanceof XPath2Item )
		{
			return Convert::ToInt( $value->getTypedValue(), $provider );
			// return $value->ToInt( $provider );
		}

		if ( is_numeric( $value ) )
		{
			if ( $value > PHP_INT_MAX ) return PHP_INT_MAX;
			if ( $value < PHP_INT_MIN ) return PHP_INT_MIN;
			return intval( $value + 0 );
		}

		if ( $value instanceof Integer || $value instanceof IntegerProxy || $value instanceof DecimalValue || $value instanceof DecimalProxy )
		{
			return $value->ToInt( $provider );
		}

		if ( $value instanceof \DateTime )
		{
			return $value->getTimestamp() + 0.0;
		}

		if ( $value instanceof DecimalValue )
		{
			return $value->ToInt( $provider );
		}

		return null;

	}
public static function ToInt( $value, $provider = null )
	{
		if ( $value instanceof ValueProxy )
		{
			return $value->ToInt( $provider );
		}

		if ( $value instanceof XPath2Item )
		{
			return Convert::ToInt( $value->getTypedValue(), $provider );
			// return $value->ToInt( $provider );
		}

		if ( is_numeric( $value ) )
		{
			if ( $value > PHP_INT_MAX ) return PHP_INT_MAX;
			if ( $value < PHP_INT_MIN ) return PHP_INT_MIN;
			return intval( $value + 0 );
		}

		if ( $value instanceof Integer || $value instanceof IntegerProxy || $value instanceof DecimalValue || $value instanceof DecimalProxy )
		{
			return $value->ToInt( $provider );
		}

		if ( $value instanceof \DateTime )
		{
			return $value->getTimestamp() + 0.0;
		}

		if ( $value instanceof DecimalValue )
		{
			return $value->ToInt( $provider );
		}

		return null;

	}
public static function ToInt ( $ value , $ provider = null ) { if ( $ value instanceof ValueProxy ) { return $ value -> ToInt ( $ provider ) ; } if ( $ value instanceof XPath2Item ) { return Convert :: ToInt ( $ value -> getTypedValue ( ) , $ provider ) ; // return $value->ToInt( $provider );
 } if ( is_numeric ( $ value ) ) { if ( $ value > PHP_INT_MAX ) return PHP_INT_MAX ; if ( $ value < PHP_INT_MIN ) return PHP_INT_MIN ; return intval ( $ value + 0 ) ; } if ( $ value instanceof Integer || $ value instanceof IntegerProxy || $ value instanceof DecimalValue || $ value instanceof DecimalProxy ) { return $ value -> ToInt ( $ provider ) ; } if ( $ value instanceof \ DateTime ) { return $ value -> getTimestamp ( ) + 0.0 ; } if ( $ value instanceof DecimalValue ) { return $ value -> ToInt ( $ provider ) ; } return null ; }
Converts the value of this instance to an equivalent integer
using the specified culture-specific formatting information.

@param object $value The value to convert
@param IFormatProvider $provider An interface implementation that supplies culture-specific formatting information.
@return int An 32-bit signed integer equivalent to the value of this instance.
Converts the value of this instance to an equivalent integer using the specified culture - specific formatting information .