Class Xyster_Orm_Set

Description

A set of Xyster_Orm_Entity objects

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

Located in /Orm/Set.php (line 28)

Xyster_Collection_Abstract
   |
   --Xyster_Collection_Set_Abstract
      |
      --Xyster_Collection_Set_Sortable
         |
         --Xyster_Data_Set
            |
            --Xyster_Orm_Set
Variable Summary
Method Summary
Xyster_Orm_Set __construct ([ $values = null])
boolean add (mixed $item)
void baseline ()
void clear ()
array getBase ()
array getDiffAdded ()
array getDiffRemoved ()
string getEntityName ()
array getPrimaryKeys ()
void relateTo (Xyster_Orm_Relation $relation, Xyster_Orm_Entity $entity)
boolean remove (mixed $item)
boolean removeAll ( $values)
boolean retainAll ( $values)
Variables
array $_base = array() (line 35)

The initial snapshot of the set

  • access: protected
Xyster_Orm_Entity $_entity (line 45)

The entity to which this set belongs

This is only set if the set is a many relation, not if pulling entities from the data store

  • access: protected
Xyster_Orm_Relation $_relation (line 55)

The relation of which the set is a result

This is only set if the set is a many relation, not if pulling entities from the data store

  • access: protected

Inherited Variables

Inherited from Xyster_Data_Set

Xyster_Data_Set::$_columns

Inherited from Xyster_Collection_Abstract

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

Creates a new entity set

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

Redefinition of:
Xyster_Data_Set::__construct()
Creates a new data set
add (line 83)

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 Xyster_Orm_Entity objects, 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_Data_Set::add()
Adds an item to the set
baseline (line 116)

Baselines the set

This method is used by Xyster_Orm_Mapper to baseline the set after its pending changes have been delt with

Do not call this method; it will lose track of changes to the set after it was loaded.

  • access: public
void baseline ()
clear (line 124)

Removes all items from the collection

  • access: public
void clear ()

Redefinition of:
Xyster_Collection_Abstract::clear()
Removes all items from the collection
getBase (line 137)

Gets the base state of this set

  • access: public
array getBase ()
getDiffAdded (line 147)

Gets any added entities since creation

  • access: public
array getDiffAdded ()
getDiffRemoved (line 157)

Gets any removed entities since creation

  • access: public
array getDiffRemoved ()
getEntityName (line 174)

Gets the class name of the entity supported by this set

By default this method will return the class name minus the 'Set' suffix.

For instance, for 'UserSet' this method will return 'User'.

Class authors can overwrite this method if their entity names aren't the same as the set name.

  • access: public
string getEntityName ()
getPrimaryKeys (line 184)

Gets the primary keys of the entities in the set

  • access: public
array getPrimaryKeys ()
getRelatedEntity (line 199)

Gets the entity related to this set

  • return: the related entity
  • access: public
Xyster_Orm_Entity getRelatedEntity ()
getRelation (line 208)

Gets the relation for this set

  • return: the relation
  • access: public
Xyster_Orm_Relation getRelation ()
relateTo (line 220)

Relates the set to an entity and relationship

  • throws: Xyster_Orm_Exception if the set is already associated
  • access: public
void relateTo (Xyster_Orm_Relation $relation, Xyster_Orm_Entity $entity)
remove (line 243)

Removes the specified value from the collection

  • return: If the value was in the collection
  • access: public
boolean remove (mixed $item)
  • mixed $item: The value to remove

Redefinition of:
Xyster_Collection_Abstract::remove()
Removes the specified value from the collection
removeAll (line 257)

Removes all of the specified values from the collection

  • return: Whether the collection changed as a result of this method
  • access: public
boolean removeAll ( $values)

Redefinition of:
Xyster_Collection_Abstract::removeAll()
Removes all of the specified values from the collection
retainAll (line 273)

Removes all values from the collection except for the ones specified

{@inherit}

  • return: Whether the collection changed as a result of this method
  • access: public
boolean retainAll ( $values)

Redefinition of:
Xyster_Collection_Abstract::retainAll()
Removes all values from the collection except for the ones specified

Inherited Methods

Inherited From Xyster_Data_Set

Xyster_Data_Set::__construct()
Xyster_Data_Set::add()
Xyster_Data_Set::addColumn()
Xyster_Data_Set::aggregate()
Xyster_Data_Set::fetchColumn()
Xyster_Data_Set::fetchOne()
Xyster_Data_Set::fetchPairs()
Xyster_Data_Set::filter()
Xyster_Data_Set::getColumns()
Xyster_Data_Set::sortBy()
Xyster_Data_Set::_createColumnsFromItem()

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:34 -0400 by phpDocumentor 1.4.2