Xataface Summary Module 0.1
Summary Reports for Xataface Apps
Public Member Functions
modules_summary Class Reference

Main summary module class. This provides the module initialization and utility methods for working with summary fields. More...

Public Member Functions

 __construct ()
 decorateSummaryField ($key, &$field)
 Decorates the field definition of a summary field. This will flesh out missing attributes. It is called automatically when the summary fields are loaded for the table the first time.
 getBaseURL ()
 Returns the base URL to this module's directory. Useful for including Javascripts and CSS.
getSummaryFields (Dataface_Table $table)
 Returns all of the summary field definitions for a particular table.
 getSummaryField (Dataface_Table $table, $fieldname)
 Returns a summary field definition for a specified field.
 getSummarySQL (Dataface_Table $table, $query, $groupBy=null, $summaryFields=null, $graftedSummaryFields=null)

Detailed Description

Main summary module class. This provides the module initialization and utility methods for working with summary fields.

Accessing this Object

All access to this object should be handled by the Dataface_ModuleTool:

 $summary = Dataface_ModuleTool::getInstance()->loadModule('modules_summary');

Definition at line 34 of file summary.php.


Constructor & Destructor Documentation

__construct ( )

Definition at line 46 of file summary.php.


Member Function Documentation

decorateSummaryField ( key,
&$  field 
)

Decorates the field definition of a summary field. This will flesh out missing attributes. It is called automatically when the summary fields are loaded for the table the first time.

Parameters:
string$keyThe field name.
array&$fieldAssociative array data structure for the field. This is modified in place by this method.
Returns:
void

Definition at line 61 of file summary.php.

getBaseURL ( )

Returns the base URL to this module's directory. Useful for including Javascripts and CSS.

Returns:
string The Base URL to this module directory.

Definition at line 81 of file summary.php.

getSummaryField ( Dataface_Table $  table,
fieldname 
)

Returns a summary field definition for a specified field.

Parameters:
Dataface_Table$tableThe table that we are pulling the field from.
string$fieldnameThe name of the field to retrieve.
Returns:
array The field definition data structure - or null if no such summary field could be found.

Definition at line 139 of file summary.php.

& getSummaryFields ( Dataface_Table $  table)

Returns all of the summary field definitions for a particular table.

Parameters:
Dataface_Table$tableThe table from which we are retrieving the summary fields.
Returns:
array Associative array of field definitions. Each field definition should contain at least the following values:
 array(
        formula => An sql expression for the summary value.
 )

Definition at line 104 of file summary.php.

getSummarySQL ( Dataface_Table $  table,
query,
groupBy = null,
summaryFields = null,
graftedSummaryFields = null 
)

Gets the SQL query to retrieve the summary for a table.

Parameters:
Dataface_Table$tableThe table to retrieve the summary for.
array$queryThe query parameters for filtering and sorting.
array$groupByOptional list of column names to group by.
array$summaryFieldsOptional list of summary fields to return.
array$graftedSummaryFieldsOptional associative array of add-on summary field definitions to be used for the purpose of this SQL.
Returns:
string SQL query.

Definition at line 160 of file summary.php.


The documentation for this class was generated from the following file:
 All Data Structures Files Functions