summaryrefslogtreecommitdiff
path: root/framework/Data/ActiveRecord
diff options
context:
space:
mode:
authorwei <>2007-04-03 01:38:15 +0000
committerwei <>2007-04-03 01:38:15 +0000
commit03dbe16b7762cc1a9e57df4e9e34bc04f46bb57f (patch)
tree4510a10b0a9fdcf6e6612d773f2bad55b8eb0534 /framework/Data/ActiveRecord
parent571b069953f559edd02f89476ebe628efa63d613 (diff)
update js onclick handler context for controls with js counterpart.
Diffstat (limited to 'framework/Data/ActiveRecord')
-rw-r--r--framework/Data/ActiveRecord/TActiveRecord.php2
-rw-r--r--framework/Data/ActiveRecord/TActiveRecordCriteria.php24
-rw-r--r--framework/Data/ActiveRecord/TActiveRecordGateway.php2
-rw-r--r--framework/Data/ActiveRecord/Vendor/TSqliteMetaDataInspector.php4
4 files changed, 29 insertions, 3 deletions
diff --git a/framework/Data/ActiveRecord/TActiveRecord.php b/framework/Data/ActiveRecord/TActiveRecord.php
index 109ae9a6..54aef3f3 100644
--- a/framework/Data/ActiveRecord/TActiveRecord.php
+++ b/framework/Data/ActiveRecord/TActiveRecord.php
@@ -520,7 +520,7 @@ abstract class TActiveRecord extends TComponent
$search = implode('|', $meta->getColumnNames());
$regexp = '/('.$search.')(and|_and_|or|_or_)?/i';
$matches = array();
- if(!preg_match_all($regexp, strtolower($condition), $matches,PREG_SET_ORDER))
+ if(!preg_match_all($regexp, $condition, $matches,PREG_SET_ORDER))
{
throw new TActiveRecordException('ar_mismatch_column_names',
$method, implode(', ', $meta->getColumnNames()), $meta->getTableName());
diff --git a/framework/Data/ActiveRecord/TActiveRecordCriteria.php b/framework/Data/ActiveRecord/TActiveRecordCriteria.php
index 533ff50a..134632e8 100644
--- a/framework/Data/ActiveRecord/TActiveRecordCriteria.php
+++ b/framework/Data/ActiveRecord/TActiveRecordCriteria.php
@@ -150,6 +150,30 @@ class TActiveRecordCriteria extends TComponent
}
/**
+ * This method is invoked before the object is deleted from the database.
+ * The method raises 'OnDelete' event.
+ * If you override this method, be sure to call the parent implementation
+ * so that the event handlers can be invoked.
+ * @param TActiveRecordEventParameter event parameter to be passed to the event handlers
+ */
+ public function onDelete($param)
+ {
+ $this->raiseEvent('OnDelete', $this, $param);
+ }
+
+ /**
+ * This method is invoked before any select query is executed on the database.
+ * The method raises 'OnSelect' event.
+ * If you override this method, be sure to call the parent implementation
+ * so that the event handlers can be invoked.
+ * @param TActiveRecordEventParameter event parameter to be passed to the event handlers
+ */
+ public function onSelect($param)
+ {
+ $this->raiseEvent('OnSelect', $this, $param);
+ }
+
+ /**
* @return string string representation of the criteria. Useful for debugging.
*/
public function __toString()
diff --git a/framework/Data/ActiveRecord/TActiveRecordGateway.php b/framework/Data/ActiveRecord/TActiveRecordGateway.php
index f9cc5bbd..be9731c5 100644
--- a/framework/Data/ActiveRecord/TActiveRecordGateway.php
+++ b/framework/Data/ActiveRecord/TActiveRecordGateway.php
@@ -300,6 +300,8 @@ class TActiveRecordGateway extends TComponent
$param = new TActiveRecordGatewayEventParameter($type,$command,$record,$data);
$manager = $record->getRecordManager();
$event = 'on'.$type;
+ if($data instanceof TActiveRecordCriteria)
+ $data->{$event}($param);
$manager->{$event}($param);
}
}
diff --git a/framework/Data/ActiveRecord/Vendor/TSqliteMetaDataInspector.php b/framework/Data/ActiveRecord/Vendor/TSqliteMetaDataInspector.php
index 1d4599a8..94f0bb72 100644
--- a/framework/Data/ActiveRecord/Vendor/TSqliteMetaDataInspector.php
+++ b/framework/Data/ActiveRecord/Vendor/TSqliteMetaDataInspector.php
@@ -55,7 +55,7 @@ class TSqliteMetaDataInspector extends TDbMetaDataInspector
$command->prepare();
$cols = array();
foreach($command->query() as $col)
- $cols[strtolower($col['name'])] = $this->getColumnMetaData($col);
+ $cols[$col['name']] = $this->getColumnMetaData($col);
return $cols;
}
@@ -73,7 +73,7 @@ class TSqliteMetaDataInspector extends TDbMetaDataInspector
$primary = $col['pk']==='1';
$autoIncrement = strtolower($type)==='integer' && $primary;
$default = $col['dflt_value'];
- return new TSqliteColumnMetaData(strtolower($col['name']),$name,$type,
+ return new TSqliteColumnMetaData($col['name'],$name,$type,
$notNull,$autoIncrement,$default,$primary);
}