protected function parse()
    {
        $query = preg_replace('/OR\s+REPLACE/', '', $this->value);
        /**
         * @TODO : Grant parse
         */
        if (preg_match(
            '/(CREATE|UPDATE|DELETE|ALTER|INSERT|DROP|SELECT|GRANT)\s+(SEQUENCE|INDEX|SYNONYM|TABLE|INTO|FROM|VIEW|)\s*([a-zA-Z-_]*)\s*/im',
            $query,
            $matches
        )
        ) {
            $this->type = trim(strtolower($matches[1]));
            if (in_array($this->type, array('create', 'drop'))) {
                $this->type = strtolower(trim(sprintf('%s_%s', $matches[1], $matches[2])));
            }

            $this->data = array(
                'identifier' => $matches[3]
            );
        }
    }
protected function parse()
    {
        $query = preg_replace('/OR\s+REPLACE/', '', $this->value);
        /**
         * @TODO : Grant parse
         */
        if (preg_match(
            '/(CREATE|UPDATE|DELETE|ALTER|INSERT|DROP|SELECT|GRANT)\s+(SEQUENCE|INDEX|SYNONYM|TABLE|INTO|FROM|VIEW|)\s*([a-zA-Z-_]*)\s*/im',
            $query,
            $matches
        )
        ) {
            $this->type = trim(strtolower($matches[1]));
            if (in_array($this->type, array('create', 'drop'))) {
                $this->type = strtolower(trim(sprintf('%s_%s', $matches[1], $matches[2])));
            }

            $this->data = array(
                'identifier' => $matches[3]
            );
        }
    }
protected function parse ( ) { $ query = preg_replace ( '/OR\s+REPLACE/' , '' , $ this -> value ) ; /**
         * @TODO : Grant parse
         */ if ( preg_match ( '/(CREATE|UPDATE|DELETE|ALTER|INSERT|DROP|SELECT|GRANT)\s+(SEQUENCE|INDEX|SYNONYM|TABLE|INTO|FROM|VIEW|)\s*([a-zA-Z-_]*)\s*/im' , $ query , $ matches ) ) { $ this -> type = trim ( strtolower ( $ matches [ 1 ] ) ) ; if ( in_array ( $ this -> type , array ( 'create' , 'drop' ) ) ) { $ this -> type = strtolower ( trim ( sprintf ( '%s_%s' , $ matches [ 1 ] , $ matches [ 2 ] ) ) ) ; } $ this -> data = array ( 'identifier' => $ matches [ 3 ] ) ; } }
Parse query
Extract type & extra data
Parse query Extract type & extra data