/*!
Returns the integer value.
559120
function title( $contentObjectAttribute, $name = null )
    {
        $categoryID = $contentObjectAttribute->attribute( "data_int" );
        $category = $categoryID > 0 ? eZProductCategory::fetch( $categoryID ) : false;
        return is_object( $category ) ? $category->attribute( 'name' ) : '';
    }
928147
public static function getInteger(&$var, $values = null)
    {
        if (is_string($var) && ctype_digit($var)) {
            $var = (int)$var;
        }
        if (!is_int($var)) {
            return 0;
        }
        if ($values !== null) {
            return in_array($var, $values, true) ? $var : $values[0];
        }

        return $var;
    }
300804
protected function detectInt($value)
    {
        if ($value < 0) {
            // int
            if ($value >= self::INT8_MIN) {
                return self::BINN_INT8;
            } else if ($value >= self::INT16_MIN) {
                return self::BINN_INT16;
            } else if ($value >= self::INT32_MIN) {
                return self::BINN_INT32;
            } else {
                return self::BINN_INT64;
            }
        } else {
            // uint
            if ($value <= self::UINT8_MAX) {
                return self::BINN_UINT8;
            } else if ($value <= self::UINT16_MAX) {
                return self::BINN_UINT16;
            } else if ($value <= self::UINT32_MAX) {
                return self::BINN_UINT32;
            } else {
                return self::BINN_UINT64;
            }
        }
    }
947836
public static function integer($val)
    {
        if (\is_array($val)) {
            return \array_map(self::class . '::integer', $val);
        }

        return (int)\filter_var($val, \FILTER_SANITIZE_NUMBER_INT);
    }
690997
public static int getInteger(
    Object  value)
  {
    if (value == null)
    {
        return 0;
    }

    if (value instanceof Number)
    {
        return ((Number) value).intValue();
    }

    return Integer.valueOf(value.toString()).intValue();

  }
422955
public function integer() {
        $this->check_role = 'integer';
        $result = $this->filter($this->value, FILTER_VALIDATE_INT);
        $this->checkResult($result);
        return $this;
    }
491045
public function getValue() {
        $value = parent::getValue();
        if ($value) {
            $value = unformat_float($value, true);
        }
        return $value;
    }
385577
public function getInt()
    {
        $r = $this->getRedValue();
        $g = $this->getGreenValue();
        $b = $this->getBlueValue();
        $a = (int) round($this->getAlphaValue() * 255);

        return (int) (($a << 24) + ($r << 16) + ($g << 8) + $b);
    }
998892
static public function isInt($value) {
    return ((string) (int) $value === (string) $value or $value === false or empty($value));
  }
12131
public function getValue()
    {
        if ($this->_value < 10) {
            return '0.0' . $this->_value;
        } elseif ($this->_value < 100) {
            return '0.' . $this->_value;
        } else {
            return substr($this->_value, 0, -2) . '.' . substr($this->_value, -2);
        }
    }
92054
public function indexOf($value): ?int
    {
        $i = 0;
        foreach ($this->items as $key => $iValue) {
            if ($value === $iValue) {
                return $i;
            }
            ++$i;
        }

        return null;
    }
790358
public function getValue($intDynamicPosition = 0)
    {
        $varValue = null;

        if ($intDynamicPosition > 0) {
            $objValidator = $this->__validator;
            $objValidator->validate($intDynamicPosition);

            $varValue = $objValidator->getValidValue($intDynamicPosition);
        } else {
            $varValue = $this->__validator->getValidValue();
        }

        //*** Sanitize the value before returning.
        $varValue = $this->sanitize($varValue, $this->__sanitize);

        return $varValue;
    }
1161310
public function asInteger(): Primitive\Integer
    {
        if (!$this->_element instanceof Primitive\Integer) {
            throw new \UnexpectedValueException(
                $this->_generateExceptionMessage(Element::TYPE_INTEGER));
        }
        return $this->_element;
    }
234711
function checkType($value)
    {
        if( $this->type !== null ) {
            // check type constraints
            if( $this->isTypeInteger() ) {
                if( ! is_numeric($value) )
                    throw new NonNumericException;
                $value = (int) $value;
            }
        }
        return $value;
    }
1038524
public function getX() : ?int 
    {
        if ( ! $this->hasX()) {
            $this->setX($this->getDefaultX());
        }
        return $this->x;
    }
1291139
protected function getValue($value)
    {
        if (is_numeric($value)) {
            return false !== strpos('.', $value) ? (double)$value : (int)$value;
        }
        return $value;
    }
1188351
public function parseInteger(string $integer): ?int
    {
        if (array_key_exists($integer, $this->bitAliases)) {
            return $this->bitAliases[$integer];
        }
        if ($integer === 'null') return null;
        if (strpos($integer, '0b') === 0) {
            return (int)base_convert($integer, 2, 10);
        }
        return (int)$integer;
    }