Doctrine\ODM\OrientDB\Caster\Caster::castDecimal PHP Метод

castDecimal() публичный Метод

Casts the internal value to an integer cmprehended between a range of accepted integers.
public castDecimal ( ) : integer
Результат integer
    public function castDecimal()
    {
        $min = (double) 4.940656458412465E-324;
        $max = (double) 1.7976931348623157E+308;
        $value = (double) $this->value;
        if ($value >= $min && $value <= $max) {
            return $value;
        }
        $castFunction = function ($value) use($min, $max) {
            if ($value < $min) {
                return $min;
            }
            if ($value > $max) {
                return $max;
            }
            return (double) $value;
        };
        if (is_numeric($this->value)) {
            return $castFunction($this->value);
        }
        return $this->handleMismatch($castFunction, 'decimal');
    }