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 
00017     final class Projection extends StaticFactory
00018     {
00022         public static function sum($property, $alias = null)
00023         {
00024             return new SumProjection($property, $alias);
00025         }
00026         
00030         public static function avg($property, $alias = null)
00031         {
00032             return new AverageNumberProjection($property, $alias);
00033         }
00034         
00038         public static function mappable(MappableObject $object, $alias = null)
00039         {
00040             return new MappableObjectProjection($object, $alias);
00041         }
00042         
00046         public static function min($property, $alias = null)
00047         {
00048             return new MinimalNumberProjection($property, $alias);
00049         }
00050         
00054         public static function max($property, $alias = null)
00055         {
00056             return new MaximalNumberProjection($property, $alias);
00057         }
00058         
00062         public static function property($property, $alias = null)
00063         {
00064             return new PropertyProjection($property, $alias);
00065         }
00066         
00070         public static function count($property = null, $alias = null)
00071         {
00072             return new RowCountProjection($property, $alias);
00073         }
00074         
00078         public static function distinctCount($property = null, $alias = null)
00079         {
00080             return new DistinctCountProjection($property, $alias);
00081         }
00082         
00086         public static function chain()
00087         {
00088             return new ProjectionChain();
00089         }
00090         
00094         public static function group($property)
00095         {
00096             return new GroupByPropertyProjection($property);
00097         }
00098         
00102         public static function groupByClass($class)
00103         {
00104             return new GroupByClassProjection($class);
00105         }
00106         
00110         public static function having(LogicalObject $logic)
00111         {
00112             return new HavingProjection($logic);
00113         }
00114         
00118         public static function clazz($className)
00119         {
00120             return new ClassProjection($className);
00121         }
00122     }
00123 ?>