rfc:functional-elements

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
rfc:functional-elements [2008/03/06 02:08] lstrojnyrfc:functional-elements [2008/03/06 02:12] – Adding usage examples lstrojny
Line 7: Line 7:
 <code php> <code php>
 foreach ($list as $element) { foreach ($list as $element) {
-    $element->method();+    $element->method();    array $params = array(), 
 +    array $condition_params = array(), 
 +    bool $collect = true, 
 +    bool $finite = true
 } }
 </code> </code>
Line 47: Line 50:
     bool $collect = true     bool $collect = true
 ) )
 +</code>
 +
 +Iterating over a list of objects, call method "testMethod" and get the list of results:
 +<code php>
 +$result = spl_iterator_element_call($list, 'testMethod');
 +</code>
 +
 +Iteratoring over a list of objects, call methods "testMethod" (with param "test") and "otherTestMethod" (with param "other") and get the list of results:
 +<code php>
 +$result = spl_iterator_element_call($list, array('testMethod', 'otherTestMethod'), array('test', 'other'));
 </code> </code>
  
rfc/functional-elements.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1