summaryrefslogtreecommitdiff
path: root/framework/Data/ActiveRecord/TActiveRecordGateway.php
diff options
context:
space:
mode:
authorwei <>2007-01-04 11:23:26 +0000
committerwei <>2007-01-04 11:23:26 +0000
commitdd028bec3822d1d9c28c35d599d687e038c7705f (patch)
treef3d2fb7f95073ea481a4dec86f0f0d30c7fe3588 /framework/Data/ActiveRecord/TActiveRecordGateway.php
parentcac90ea6547fe194ab6ab101dfe11a0b751823ca (diff)
Add chat demo and tutorial.
Diffstat (limited to 'framework/Data/ActiveRecord/TActiveRecordGateway.php')
-rw-r--r--framework/Data/ActiveRecord/TActiveRecordGateway.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/framework/Data/ActiveRecord/TActiveRecordGateway.php b/framework/Data/ActiveRecord/TActiveRecordGateway.php
index e7ea5e46..1cb1c79f 100644
--- a/framework/Data/ActiveRecord/TActiveRecordGateway.php
+++ b/framework/Data/ActiveRecord/TActiveRecordGateway.php
@@ -247,6 +247,20 @@ class TActiveRecordGateway extends TComponent
}
/**
+ * Delete multiple records by criteria.
+ * @param TActiveRecord active record finder instance.
+ * @param TActiveRecordCriteria search criteria
+ * @return int number of records.
+ */
+ public function deleteRecordsByCriteria(TActiveRecord $record, $criteria)
+ {
+ $meta = $this->getMetaData($record);
+ $command = $meta->getDeleteByCriteriaCommand($record->getDBConnection(),$criteria);
+ $this->raiseCommandEvent(TActiveRecordStatementType::Delete,$command,$record,$criteria);
+ return $command->execute();
+ }
+
+ /**
* Raise the corresponding command event, insert, update, delete or select.
* @param string command type
* @param TDbCommand sql command to be executed.