CombineQuery.class.php

Go to the documentation of this file.
00001 <?php
00002 /***************************************************************************
00003  *   Copyright (C) 2004-2008 by Sergey S. Sergeev                          *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU Lesser General Public License as        *
00007  *   published by the Free Software Foundation; either version 3 of the    *
00008  *   License, or (at your option) any later version.                       *
00009  *                                                                         *
00010  ***************************************************************************/
00011     
00024     final class CombineQuery extends StaticFactory
00025     {
00026         const UNION             = 'UNION';
00027         const UNION_ALL         = 'UNION ALL';
00028         
00029         const INTERSECT         = 'INTERSECT';
00030         const INTERSECT_ALL     = 'INTERSECT ALL';
00031         
00032         const EXCEPT            = 'EXCEPT';
00033         const EXCEPT_ALL        = 'EXCEPT ALL';
00034         
00038         public static function union($left, $right)
00039         {
00040             return new QueryCombination($left, $right, self::UNION);
00041         }
00042         
00046         public static function unionBlock()
00047         {
00048             $args = func_get_args();
00049             
00050             return QueryChain::block($args, self::UNION);       
00051         }
00052         
00056         public static function unionAll($left, $right)
00057         {
00058             return new QueryCombination($left, $right, self::UNION_ALL);
00059         }
00060         
00064         public static function unionAllBlock()
00065         {
00066             $args = func_get_args();
00067             
00068             return QueryChain::block($args, self::UNION_ALL);
00069         }
00070         
00074         public static function intersect($left, $right)
00075         {
00076             return new QueryCombination($left, $right, self::INTERSECT);
00077         }
00078         
00082         public static function intersectBlock()
00083         {
00084             $args = func_get_args();
00085             
00086             return QueryChain::block($args, self::INTERSECT);
00087         }
00088         
00092         public static function intersectAll($left, $right)
00093         {
00094             return new QueryCombination($left, $right, self::INTERSECT_ALL);
00095         }
00096         
00100         public static function intersectAllBlock()
00101         {
00102             $args = func_get_args();
00103             
00104             return QueryChain::block($args, self::INTERSECT_ALL);
00105         }
00106         
00110         public static function except($left, $right)
00111         {
00112             return new QueryCombination($left, $right, self::EXCEPT);
00113         }
00114         
00118         public static function exceptBlock()
00119         {
00120             $args = func_get_args();
00121             
00122             return QueryChain::block($args, self::EXCEPT);
00123         }
00124     
00128         public static function exceptAll($left, $right)
00129         {
00130             return new QueryCombination($left, $right, self::EXCEPT_ALL);
00131         }
00132         
00136         public static function exceptAllBlock()
00137         {
00138             $args = func_get_args();
00139             
00140             return QueryChain::block($args, self::EXCEPT_ALL);
00141         }
00142     }
00143 ?>