diff options
author | Christian Schneider | 2008-10-01 14:55:43 +0000 |
---|---|---|
committer | Christian Schneider | 2008-10-01 14:55:43 +0000 |
commit | 89ee50329396d4b2e09fb28ef93cceeaf03ae5cb (patch) | |
tree | 64afb60ed4a3fb2b75cfa59de21e73dcca42edd3 /README | |
parent | 4813565b22eadbdf23985a7635b69e6c7e3d3659 (diff) | |
download | itools-89ee50329396d4b2e09fb28ef93cceeaf03ae5cb.tar.gz itools-89ee50329396d4b2e09fb28ef93cceeaf03ae5cb.tar.bz2 itools-89ee50329396d4b2e09fb28ef93cceeaf03ae5cb.zip |
Added PHP 5 Iterators to README
Diffstat (limited to 'README')
-rw-r--r-- | README | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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 |