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() | |
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. }
| Pluf_Model_Set::__construct | ( | $ | data, | |
| $ | keys = array() | |||
| ) |
| 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 | ) |
Pluf_Model_Set::$data = array() [protected] |
Pluf_Model_Set::$keys = array() [protected] |