src/Spiritix/LadaCache/Reflector.php
public function getType()
    {
        $sql = $this->getSql();

        $type = strtok(strtolower(trim($sql)), ' ');
        $type = preg_replace ('/[^a-z]/i', '', $type);

        $allowedTypes = [
            self::QUERY_TYPE_SELECT,
            self::QUERY_TYPE_INSERT,
            self::QUERY_TYPE_UPDATE,
            self::QUERY_TYPE_DELETE,
            self::QUERY_TYPE_TRUNCATE,
        ];

        if (!in_array($type, $allowedTypes)) {
            throw new RuntimeException('Invalid query type');
        }

        return $type;
    }
public function getType()
    {
        $sql = $this->getSql();

        $type = strtok(strtolower(trim($sql)), ' ');
        $type = preg_replace ('/[^a-z]/i', '', $type);

        $allowedTypes = [
            self::QUERY_TYPE_SELECT,
            self::QUERY_TYPE_INSERT,
            self::QUERY_TYPE_UPDATE,
            self::QUERY_TYPE_DELETE,
            self::QUERY_TYPE_TRUNCATE,
        ];

        if (!in_array($type, $allowedTypes)) {
            throw new RuntimeException('Invalid query type');
        }

        return $type;
    }
public function getType ( ) { $ sql = $ this -> getSql ( ) ; $ type = strtok ( strtolower ( trim ( $ sql ) ) , ' ' ) ; $ type = preg_replace ( '/[^a-z]/i' , '' , $ type ) ; $ allowedTypes = [ self :: QUERY_TYPE_SELECT , self :: QUERY_TYPE_INSERT , self :: QUERY_TYPE_UPDATE , self :: QUERY_TYPE_DELETE , self :: QUERY_TYPE_TRUNCATE , ] ; if ( ! in_array ( $ type , $ allowedTypes ) ) { throw new RuntimeException ( 'Invalid query type' ) ; } return $ type ; }
Returns the type of the query.

@return string
Returns the type of the query .