Class Xyster_Data_Set

Description

A set that holds rows and columns

  • copyright: Copyright (c) 2007-2008 Irrational Logic (http://irrationallogic.net)
  • license: New BSD License

Located in /Data/Set.php (line 31)

Xyster_Collection_Abstract
   |
   --Xyster_Collection_Set_Abstract
      |
      --Xyster_Collection_Set_Sortable
         |
         --Xyster_Data_Set
Direct descendents
Class Description
Xyster_Data_Tuple A set that holds rows and columns
Xyster_Orm_Set A set of Xyster_Orm_Entity objects
Variable Summary
Method Summary
Xyster_Data_Set __construct ([ $values = null])
boolean add (mixed $item)
void addColumn (string $column)
array fetchColumn (mixed $field)
mixed fetchOne ()
array fetchPairs (mixed $key, mixed $value)
void filter (Xyster_Data_Criterion $criteria)
void sortBy (mixed $sorts)
void _createColumnsFromItem (mixed $item)
Variables
Xyster_Collection_Set $_columns (line 36)
  • access: protected

Inherited Variables

Inherited from Xyster_Collection_Abstract

Xyster_Collection_Abstract::$_items
Methods
Constructor __construct (line 43)

Creates a new data set

  • access: public
Xyster_Data_Set __construct ([ $values = null])

Redefinition of:
Xyster_Collection_Set_Sortable::__construct()
Creates a new set

Redefined in descendants as:
add (line 73)

Adds an item to the set

This collection doesn't accept duplicate values, and will return false if the provided value is already in the collection.

It can only accept arrays or objects as items, otherwise it will throw a Xyster_Data_Set_Exception.

  • return: Whether the set changed as a result of this method
  • throws: Xyster_Data_Set_Exception if the collection cannot contain the value
  • access: public
boolean add (mixed $item)
  • mixed $item: The item to add

Redefinition of:
Xyster_Collection_Set_Abstract::add()
Adds an item to the set

Redefined in descendants as:
addColumn (line 90)

Adds a column to the set

  • throws: Xyster_Data_Set_Exception if the method is called after the set contains items
  • access: public
void addColumn (string $column)
  • string $column: The name of the column
aggregate (line 105)

Perform an aggregate function on a column

  • access: public
mixed aggregate (Xyster_Data_Field_Aggregate $field, Xyster_Data_Aggregate $function)
fetchColumn (line 133)

Converts an entire column of values to an array

  • return: The fetched values from the column
  • access: public
array fetchColumn (mixed $field)
fetchOne (line 149)

Returns the first column of the first row of a statement

  • return: The value of the first column in the first row
  • access: public
mixed fetchOne ()
fetchPairs (line 164)

Converts 2 fields into an associative array

  • return: The translated fields
  • access: public
array fetchPairs (mixed $key, mixed $value)
filter (line 181)

Removes elements in the collection based on a criteria

  • access: public
void filter (Xyster_Data_Criterion $criteria)
getColumns (line 190)

Gets the columns that have been added to the set

  • access: public
Xyster_Collection_Set getColumns ()
sortBy (line 202)

Sorts the collection by one or more columns and directions

The $sorts parameter can either be a single Xyster_Data_Sort or an array containing multiple.

  • access: public
void sortBy (mixed $sorts)
  • mixed $sorts: The sorts to include
_createColumnsFromItem (line 233)

Creates the columns for this set from an array or object

  • access: protected
void _createColumnsFromItem (mixed $item)
  • mixed $item: either an array or an object

Inherited Methods

Inherited From Xyster_Collection_Set_Sortable

Xyster_Collection_Set_Sortable::__construct()
Xyster_Collection_Set_Sortable::sort()

Inherited From Xyster_Collection_Set_Abstract

Xyster_Collection_Set_Abstract::add()

Inherited From Xyster_Collection_Abstract

Xyster_Collection_Abstract::add()
Xyster_Collection_Abstract::clear()
Xyster_Collection_Abstract::contains()
Xyster_Collection_Abstract::containsAll()
Xyster_Collection_Abstract::containsAny()
Xyster_Collection_Abstract::count()
Xyster_Collection_Abstract::getIterator()
Xyster_Collection_Abstract::isEmpty()
Xyster_Collection_Abstract::merge()
Xyster_Collection_Abstract::remove()
Xyster_Collection_Abstract::removeAll()
Xyster_Collection_Abstract::retainAll()
Xyster_Collection_Abstract::toArray()
Xyster_Collection_Abstract::__toString()

Documentation generated on Mon, 19 May 2008 17:07:35 -0400 by phpDocumentor 1.4.2