yii\sphinx\Schema::getPdoType PHP Метод

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

Determines the PDO type for the given PHP data value.
См. также: http://www.php.net/manual/en/pdo.constants.php
public getPdoType ( mixed $data ) : integer
$data mixed the data whose PDO type is to be determined
Результат integer the PDO type
    public function getPdoType($data)
    {
        static $typeMap = ['bool' => \PDO::PARAM_BOOL, 'boolean' => \PDO::PARAM_BOOL, 'int' => \PDO::PARAM_INT, 'integer' => \PDO::PARAM_INT, 'string' => \PDO::PARAM_STR, 'resource' => \PDO::PARAM_LOB, 'NULL' => \PDO::PARAM_NULL];
        $type = gettype($data);
        return isset($typeMap[$type]) ? $typeMap[$type] : \PDO::PARAM_STR;
    }