summaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
authorChristian Schneider2008-10-01 14:55:43 +0000
committerChristian Schneider2008-10-01 14:55:43 +0000
commit89ee50329396d4b2e09fb28ef93cceeaf03ae5cb (patch)
tree64afb60ed4a3fb2b75cfa59de21e73dcca42edd3 /README
parent4813565b22eadbdf23985a7635b69e6c7e3d3659 (diff)
downloaditools-89ee50329396d4b2e09fb28ef93cceeaf03ae5cb.tar.gz
itools-89ee50329396d4b2e09fb28ef93cceeaf03ae5cb.tar.bz2
itools-89ee50329396d4b2e09fb28ef93cceeaf03ae5cb.zip
Added PHP 5 Iterators to README
Diffstat (limited to 'README')
-rw-r--r--README8
1 files changed, 8 insertions, 0 deletions
diff --git a/README b/README
index 936dd2f..8235c3c 100644
--- a/README
+++ b/README
@@ -74,6 +74,14 @@ Example:
$record = new T_Customers('ID' => 'mueller');
$record->update('email' => "mueller@spam.com");
$response = "Email added for $record->name";
+ # Using Iterators (PHP 5+ only):
+ foreach (new T_Customers as $customer) { ... } # Iterate all customers
+ foreach (new T_Customers('age' => 42) as $customer) { ... }
+ foreach (new T_Customers as $id => $customer) { ... } # $id = $customer->_key
+ # ... you can iterate over any query (also multiple times):
+ $customers->select('age' => 42);
+ foreach ($customers as $customer) { foo($customer); }
+ foreach ($customers as $customer) { bar($customer); }
Functions:
it_dbi::createclasses($config) -- create database objects for each table name