Projection.class.php

Go to the documentation of this file.
00001 <?php
00002 /***************************************************************************
00003  *   Copyright (C) 2006-2007 by Konstantin V. Arkhipov                     *
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 /* $Id: Projection.class.php 4687 2007-12-09 18:57:18Z voxus $ */
00012 
00018     final class Projection extends StaticFactory
00019     {
00023         public static function sum($property, $alias = null)
00024         {
00025             return new SumProjection($property, $alias);
00026         }
00027         
00031         public static function avg($property, $alias = null)
00032         {
00033             return new AverageNumberProjection($property, $alias);
00034         }
00035         
00039         public static function mappable(MappableObject $object, $alias = null)
00040         {
00041             return new MappableObjectProjection($object, $alias);
00042         }
00043         
00047         public static function min($property, $alias = null)
00048         {
00049             return new MinimalNumberProjection($property, $alias);
00050         }
00051         
00055         public static function max($property, $alias = null)
00056         {
00057             return new MaximalNumberProjection($property, $alias);
00058         }
00059         
00063         public static function property($property, $alias = null)
00064         {
00065             return new PropertyProjection($property, $alias);
00066         }
00067         
00071         public static function count($property = null, $alias = null)
00072         {
00073             return new RowCountProjection($property, $alias);
00074         }
00075         
00079         public static function distinctCount($property = null, $alias = null)
00080         {
00081             return new DistinctCountProjection($property, $alias);
00082         }
00083         
00087         public static function chain()
00088         {
00089             return new ProjectionChain();
00090         }
00091         
00095         public static function group($property)
00096         {
00097             return new GroupByPropertyProjection($property);
00098         }
00099         
00103         public static function groupByClass($class)
00104         {
00105             return new GroupByClassProjection($class);
00106         }
00107         
00111         public static function having(LogicalObject $logic)
00112         {
00113             return new HavingProjection($logic);
00114         }
00115         
00119         public static function clazz($className)
00120         {
00121             return new ClassProjection($className);
00122         }
00123     }
00124 ?>

Generated on Sun Dec 9 21:56:23 2007 for onPHP by  doxygen 1.5.4