PHP Classes
Icontem

File: Sql_Parser/Sql_ParserUnion.class.php


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Tom Schaefer  >  SQL Parse and Compile  >  Sql_Parser/Sql_ParserUnion.class.php  
File: Sql_Parser/Sql_ParserUnion.class.php
Role: Class source
Content type: text/plain
Description: parses union statement into object
Class: SQL Parse and Compile
Parse and compose SQL queries programatically
 

Contents

Class file image Download
<?php

/**
 *
 * Sql_ParserUnion
 * @package Sql
 * @subpackage Sql_Parser
 * @author Thomas Schäfer
 * @since 30.11.2008 07:49:30
 * @desc parses a sql Union into object
 */

/**
 *
 * Sql_ParserUnion
 * @package Sql
 * @subpackage Sql_Parser
 * @author Thomas Schäfer
 * @since 30.11.2008 07:49:30
 * @desc parses a sql Union into object
 */
class Sql_ParserUnion implements Sql_InterfaceParser {

    
public static function doParse($subSelect false
    {
        
$tree = array('Command' => 'union');
        
        
$SQL Sql_Object::lexer()->string;
        
$selects preg_split('/union/i'$SQL);
        
        foreach(
$selects as $index => $select) {
            
$object = new Sql_Parser($select);
            
$tree["Union"][] = $object->parse();    
        }
        return 
$tree;        
    }

    
public static function parse(){
        return 
self::doParse();
    }
}


 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products