API > eden > collection.php
View Source

class Eden_Collection

A collection is a list of common models used for mass manipulations.

  • Extends: Eden_Class
  • Implements: ArrayAccess, Iterator, Serializable, Countable

Constants

  • FIRST: first
  • LAST: last
  • MODEL: Eden_Model

Public Methods

public function add($row = array())

Adds a row to the collection

Arguments

  1. array|Eden_Model

Returns this

public function count()

returns size using the Countable interface

Returns string

public function each($callback)

Loops through returned result sets

Arguments

  1. *callable

Returns this

public function current()

Returns the current item For Iterator interface

Returns void

public function get($modified = true)

Returns the row array

Arguments

  1. bool

Returns array

public function key()

Returns th current position For Iterator interface

Returns void

public function next()

Increases the position For Iterator interface

Returns void

public function offsetExists($offset)

isset using the ArrayAccess interface

Arguments

  1. number

Returns bool

public function offsetGet($offset)

returns data using the ArrayAccess interface

Arguments

  1. number

Returns bool

public function offsetSet($offset, $value)

Sets data using the ArrayAccess interface

Arguments

  1. number
  2. mixed

Returns void

public function offsetUnset($offset)

unsets using the ArrayAccess interface

Arguments

  1. number

Returns bool

public function rewind()

Rewinds the position For Iterator interface

Returns void

public function serialize()

returns serialized data using the Serializable interface

Returns string

public function set(array $data = array())

Sets data

Returns this

public function setModel($model)

Sets default model

Arguments

  1. string

Returns this

public function unserialize($data)

sets data using the Serializable interface

Arguments

  1. string

Returns void

public function valid()

Validates whether if the index is set For Iterator interface

Returns void

class Eden_Collection_Error

Model Errors

Constants

  • NOT_COLLECTION: The data passed into __ruct is not a collection.
  • NOT_SUB_MODEL: Class %s is not a child of Eden_Model

© 2012 Openovate Labs. All rights reserved.