コード例 #1
0
 public function create($parsed)
 {
     $k = key($parsed);
     switch ($k) {
         case "UNION":
         case "UNION ALL":
             throw new UnsupportedFeatureException($k);
             break;
         case "SELECT":
             $builder = new SelectStatementBuilder($parsed);
             $this->created = $builder->build($parsed);
             break;
         case "INSERT":
             $builder = new InsertStatementBuilder($parsed);
             $this->created = $builder->build($parsed);
             break;
         case "DELETE":
             $builder = new DeleteStatementBuilder($parsed);
             $this->created = $builder->build($parsed);
             break;
         case "UPDATE":
             $builder = new UpdateStatementBuilder($parsed);
             $this->created = $builder->build($parsed);
             break;
         case "RENAME":
             $this->created = $this->processRenameTableStatement($parsed);
             break;
         case "SHOW":
             $builder = new ShowStatementBuilder($parsed);
             $this->created = $builder->build($parsed);
             break;
         case "CREATE":
             $builder = new CreateStatementBuilder($parsed);
             $this->created = $builder->build($parsed);
             break;
         default:
             throw new UnsupportedFeatureException($k);
             break;
     }
     return $this->created;
 }
コード例 #2
0
 public function create($parsed)
 {
     $k = key($parsed);
     switch ($k) {
         case 'UNION':
         case 'UNION ALL':
             throw new UnsupportedFeatureException($k);
             break;
         case 'SELECT':
             $builder = new SelectStatementBuilder();
             $this->created = $builder->build($parsed);
             break;
         case 'INSERT':
             $builder = new InsertStatementBuilder();
             $this->created = $builder->build($parsed);
             break;
         case 'DELETE':
             $builder = new DeleteStatementBuilder();
             $this->created = $builder->build($parsed);
             break;
         case 'UPDATE':
             $builder = new UpdateStatementBuilder();
             $this->created = $builder->build($parsed);
             break;
         case 'RENAME':
             $builder = new RenameStatementBuilder();
             $this->created = $builder->build($parsed);
             break;
         case 'SHOW':
             $builder = new ShowStatementBuilder();
             $this->created = $builder->build($parsed);
             break;
         case 'CREATE':
             $builder = new CreateStatementBuilder();
             $this->created = $builder->build($parsed);
             break;
         case 'BRACKET':
             $builder = new BracketStatementBuilder();
             $this->created = $builder->build($parsed);
             break;
         case 'DROP':
             $builder = new DropStatementBuilder();
             $this->created = $builder->build($parsed);
             break;
         default:
             throw new UnsupportedFeatureException($k);
             break;
     }
     return $this->created;
 }