Class Aggregate
Calculate an Aggregate on a particular field of a particular DataObject type (possibly with an additional filter before the aggregate)
Implemented as a class to provide a semi-DSL method of calculating Aggregates. DataObject has a function that will create & return an instance of this class with the DataObject type and filter set, but at that point we don't yet know the aggregate function or field
This class captures any XML_val or unknown call, and uses that to get the field & aggregate function & then return the result
Two ways of calling
$aggregate->XML_val(aggregate_function, array(field)) - For templates $aggregate->aggregate_function(field) - For PHP
Aggregate functions are uppercased by this class, but are otherwise assumed to be valid SQL functions. Some examples: Min, Max, Avg
Aggregates are often used as portions of a cacheblock key. They are therefore cached themselves, in the 'aggregate' cache, although the invalidation logic prefers speed over keeping valid data.
NOTE: The cache logic uses tags, and so a backend that supports tags is required. Currently only the File backend (and the two-level backend with the File backend as the slow store) meets this requirement
- Object
-
ViewableData
implements
IteratorAggregate
-
Aggregate
Direct known subclasses
Methods summary
protected static
|
|
public static
|
#
flushCache( mixed $class = null )
Clear the aggregate cache for a given type, or pass nothing to clear all aggregate caches |
public
|
|
protected
|
|
public
string
|
|
public
mixed
|
Methods inherited from ViewableData
ATT_val(),
BaseHref(),
CSSClasses(),
ColumnBreak(),
ColumnCalc(),
ColumnNumber(),
ColumnPad(),
ColumnPos(),
CurrentMember(),
CurrentPage(),
Debug(),
Even(),
EvenOdd(),
First(),
FirstLast(),
HasPerm(),
IsAjax(),
JS_val(),
Last(),
Me(),
Middle(),
MiddleString(),
Modulus(),
MultipleOf(),
Odd(),
Pos(),
RAW_val(),
SQL_val(),
ThemeDir(),
ThemeName(),
Top(),
TotalItems(),
__get(),
__isset(),
__set(),
buildCastingCache(),
cachedCall(),
castingClass(),
castingHelper(),
castingHelperPair(),
castingObjectCreator(),
castingObjectCreatorPair(),
customise(),
defineMethods(),
escapeTypeForField(),
getField(),
getIterator(),
getSecurityID(),
getXMLValues(),
hasField(),
hasValue(),
i18nLocale(),
iteratorProperties(),
obj(),
renderWith(),
setCustomisedObj(),
setField()
Methods inherited from Object
__toString(),
__wakeup(),
addMethodsFrom(),
addStaticVars(),
addWrapperMethod(),
add_extension(),
add_static_var(),
allMethodNames(),
cacheToFile(),
cacheToFileWithArgs(),
clearCache(),
combined_static(),
create(),
createMethod(),
create_from_string(),
exists(),
extInstance(),
extend(),
getCustomClass(),
getExtensionInstance(),
getExtensionInstances(),
get_extensions(),
get_static(),
hasExtension(),
hasMethod(),
has_extension(),
invokeWithExtensions(),
is_a(),
loadCache(),
parentClass(),
parse_class_spec(),
remove_extension(),
sanitiseCachename(),
saveCache(),
set_stat(),
set_static(),
set_uninherited(),
stat(),
strong_create(),
uninherited(),
uninherited_static(),
useCustomClass()
Magic methods summary
Properties summary
public static
mixed
|
$cache |
Properties inherited from ViewableData
$casting,
$customisedObject,
$default_cast,
$failover,
$iteratorPos,
$iteratorTotalItems