From 89ee50329396d4b2e09fb28ef93cceeaf03ae5cb Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Wed, 1 Oct 2008 14:55:43 +0000 Subject: Added PHP 5 Iterators to README --- README | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'README') 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 -- cgit v1.2.3