/** * Returns the $integer if greater than zero, otherwise returns zero. * * @param integer $theInt Integer string to process * @return integer * @deprecated since TYPO3 4.6, will be removed in TYPO3 6.0 - Use t3lib_utility_Math::convertToPositiveInteger() instead */ public static function intval_positive($theInt) { return t3lib_utility_Math::convertToPositiveInteger($theInt); }
/** * Returns the $integer if greater than zero, otherwise returns zero. * * @param integer $theInt Integer string to process * @return integer * @deprecated since TYPO3 4.6, will be removed in TYPO3 4.8 - Use t3lib_utility_Math::convertToPositiveInteger() instead */ public static function intval_positive($theInt) { self::logDeprecatedFunction(); return t3lib_utility_Math::convertToPositiveInteger($theInt); }
/** * Returns the $integer if greater than zero, otherwise returns zero. * * @param integer $theInt Integer string to process * @return integer */ public static function convertToPositiveInteger($theInt) { $result = ''; if (self::isEqualOrHigherSixZero()) { $result = \TYPO3\CMS\Core\Utility\MathUtility::convertToPositiveInteger($theInt); } elseif (class_exists('t3lib_utility_Math')) { $result = t3lib_utility_Math::convertToPositiveInteger($theInt); } else { $result = t3lib_div::intval_positive($theInt); } return $result; }
public static function intval_positive($theInt) { $result = FALSE; $callingClassName = '\\TYPO3\\CMS\\Core\\Utility\\MathUtility'; if (class_exists($callingClassName) && method_exists($callingClassName, 'convertToPositiveInteger')) { $result = call_user_func($callingClassName . '::convertToPositiveInteger', $theInt); } else { if (class_exists('t3lib_utility_Math') && method_exists('t3lib_utility_Math', 'convertToPositiveInteger')) { $result = t3lib_utility_Math::convertToPositiveInteger($theInt); } else { if (class_exists('t3lib_div') && method_exists('t3lib_div', 'intval_positive')) { $result = t3lib_div::intval_positive($theInt); } } } return $result; }
/** * Wrapper to support old and new method to test integer values. * * @param integer $value * @return integer */ public static function convertToPositiveInteger($value) { if (version_compare(TYPO3_version, '4.6.0', '>=')) { $result = t3lib_utility_Math::convertToPositiveInteger($value); } else { $result = t3lib_div::intval_positive($value); } return $result; }