From e306989c6d03aac37e2557465b4812ea21970065 Mon Sep 17 00:00:00 2001 From: wei <> Date: Wed, 24 Jan 2007 05:52:22 +0000 Subject: Fixed #517, #519, #521 --- .../protected/pages/Advanced/Samples/I18N/Home.php | 5 +++-- .../protected/pages/Advanced/Samples/I18N/config.xml | 4 ++-- .../protected/pages/Database/ActiveRecord.page | 18 ++++++++++++++++++ 3 files changed, 23 insertions(+), 4 deletions(-) (limited to 'demos') diff --git a/demos/quickstart/protected/pages/Advanced/Samples/I18N/Home.php b/demos/quickstart/protected/pages/Advanced/Samples/I18N/Home.php index d9a261d6..f0d127b9 100644 --- a/demos/quickstart/protected/pages/Advanced/Samples/I18N/Home.php +++ b/demos/quickstart/protected/pages/Advanced/Samples/I18N/Home.php @@ -1,4 +1,4 @@ -Request['lang']; - if(CultureInfo::validCulture($lang)) //only valid lang is permitted + $info = new CultureInfo(); + if($info->validCulture($lang)) //only valid lang is permitted $this->getApplication()->getGlobalization()->setCulture($lang); } diff --git a/demos/quickstart/protected/pages/Advanced/Samples/I18N/config.xml b/demos/quickstart/protected/pages/Advanced/Samples/I18N/config.xml index e6fa03ec..5c80f48b 100644 --- a/demos/quickstart/protected/pages/Advanced/Samples/I18N/config.xml +++ b/demos/quickstart/protected/pages/Advanced/Samples/I18N/config.xml @@ -1,4 +1,4 @@ - + @@ -8,7 +8,7 @@ - + diff --git a/demos/quickstart/protected/pages/Database/ActiveRecord.page b/demos/quickstart/protected/pages/Database/ActiveRecord.page index 0e8b8f7d..59d62495 100644 --- a/demos/quickstart/protected/pages/Database/ActiveRecord.page +++ b/demos/quickstart/protected/pages/Database/ActiveRecord.page @@ -373,6 +373,24 @@ $finder->deleteByPk(array( array($key1,$key2), array($key3,$key4), .. ));

+

deleteAll() and deleteBy*()

+

+To delete by a criteria, use deleteAll($criteria) and deleteBy*() +with similar synatx to findAll($criteria) and findAllBy*() as +described above. +

+ +//delete all records with matching Name +$finder->deleteAll('Name = ?', $name); +$finder->deleteByName($name); + +//delete by username and password +$finder->deleteBy_Username_And_Password($name,$pass); + +

+ + +

Transactions

All Active Record objects contains the property DbConnection that can be used to obtain a transaction object. -- cgit v1.2.3