Location: PHPKode > scripts > QValidation > qvalidation/Validation/DataType/Integer.php
<?php

class Validation_DataType_Integer extends Validation implements ValidInterface {

	public static function getInstance(){
		return new Validation_DataType_Integer;
	}

	public static function positiveInteger($value) {
		return ($value > 0 ? true : false);
	}

	public static function positiveZeroInteger($value) {
		return ($value >= 0 ? true : false);
	}

	public static function negativeInteger($value) {
		return ($value < 0 ? true : false);
	}

	public static function negativeZeroInteger($value) {
		return ($value <= 0 ? true : false);
	}

	public static function validateInt($value) {
		if(strlen($value)==0) {
			return false;
		}
		return is_numeric($value);
	}

	public static function validateGreaterMin($value, $min) {
		return (is_integer($value) and $value > $min);
	}

	public static function validateLowerMax($value, $max) {
		return (is_integer($value) and $value > $max);
	}

	public static function validateGreaterEqualMin($value, $min) {
		return (is_integer($value) and $value >= $min);
	}

	public static function validateLowerEqualMax($value, $max) {
		return (is_integer($value) and $value <= $max);
	}

	public static function validateInnerRange($value, $min, $max) {
		return 	(
					self::validateGreaterMin($value, $min) and
					self::validateLowerMax($value, $max)
				);
	}

	public static function validateOuterRange($value, $min, $max) {
		return 	(
					self::validateGreaterEqualMin($value, $min) and
					self::validateLowerEqualMax($value, $max)
				);
	}


}
Return current item: QValidation