PHP Classes
Icontem

File: Sql_Compiler/Sql_CompilerUnion.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_Compiler/Sql_CompilerUnion.class.php  
File: Sql_Compiler/Sql_CompilerUnion.class.php
Role: Class source
Content type: text/plain
Description: compile union statement
Class: SQL Parse and Compile
Parse and compose SQL queries programatically
 

Contents

Class file image Download
<?php

/**
 *
 * Sql_CompilerUnion
 * @package Sql
 * @subpackage Sql_Parser
 * @author Thomas Schäfer
 * @since 12.12.2008
 * @desc compile a sql Union object into string
 */
/**
 *
 * Sql_CompilerUnion
 * @package Sql
 * @subpackage Sql_Parser
 * @author Thomas Schäfer
 * @since 12.12.2008
 * @desc compile a sql Union object into string
 */

class Sql_CompilerUnion implements Sql_InterfaceCompiler 
{

    
public static function doCompile() 
    {
        
$tree Sql_Object::get("tree");
        
$array = array();
        foreach(
Sql_Object::get("tree.Union") as $index => $statement) {
            
$compose = new Sql_Compiler();
            
$array[] = $compose->compile($statement);
        }
        return 
implode(Sql_Compiler::LINEBREAK strtoupper($tree["Command"]). Sql_Compiler::LINEBREAK$array);
        
    }
    
    
public static function compile($tree)
    {
        
Sql_Object::set("tree"$tree);
        return 
self::doCompile();
    }

}

 
  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