Pluf_Model_Set Class Reference

List of all members.

Public Member Functions

 __construct ($data, $keys=array())
 current ()
 key ()
 next ()
 rewind ()
 valid ()
 count ()
 offsetUnset ($index)
 offsetSet ($index, $value)
 offsetGet ($index)
 offsetExists ($index)

Protected Attributes

 $data = array()
 $keys = array()


Detailed Description

Allow to iterate over an array of standard classes with 'model_class' and 'model_id' properties set.

Optional properties from the classses can also be extracted and added as properties to the model.

Suppose you have a $data array with: array( (object) array('model_class' => 'MyApp_Item', 'model_id' => 32, 'foo' => 'bingo plus'), (object) array('model_class' => 'MyApp_Bong', 'model_id' => 12, 'foo' => 'youpla'), (object) array('model_class' => 'MyApp_Item', 'model_id' => 14, 'foo' => 'bingo'), );

You can do: $set = new Pluf_Model_Set($data, array('foo' => '_Foo')); foreach ($set as $res) { echo $res; // Will be the loaded model based on the class and id. echo $res->_Foo; // will contain the value foo of the $data array. }


Constructor & Destructor Documentation

Pluf_Model_Set::__construct ( data,
keys = array() 
)


Member Function Documentation

Pluf_Model_Set::current (  ) 

Get the current item.

Pluf_Model_Set::key (  ) 

Pluf_Model_Set::next (  ) 

Pluf_Model_Set::rewind (  ) 

Pluf_Model_Set::valid (  ) 

Pluf_Model_Set::count (  ) 

Pluf_Model_Set::offsetUnset ( index  ) 

Pluf_Model_Set::offsetSet ( index,
value 
)

Pluf_Model_Set::offsetGet ( index  ) 

Pluf_Model_Set::offsetExists ( index  ) 


Member Data Documentation

Pluf_Model_Set::$data = array() [protected]

Pluf_Model_Set::$keys = array() [protected]


The documentation for this class was generated from the following file:

Generated on Wed Feb 3 15:44:52 2010 for Pluf by  doxygen