summaryrefslogtreecommitdiff
path: root/framework/Data
diff options
context:
space:
mode:
authorqiang.xue <>2008-10-21 02:13:28 +0000
committerqiang.xue <>2008-10-21 02:13:28 +0000
commit22d29033506b0caa34b4f8f5d16de9f1ffbb6ec9 (patch)
tree9b7c5d61942936d12306819cedd08ec19207e35d /framework/Data
parent724874e7bd39d787fff39bde2a44076e1d873a30 (diff)
Fixed issue #11.
Diffstat (limited to 'framework/Data')
-rw-r--r--framework/Data/ActiveRecord/TActiveRecord.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/framework/Data/ActiveRecord/TActiveRecord.php b/framework/Data/ActiveRecord/TActiveRecord.php
index 6a27acb4..b8eb0b84 100644
--- a/framework/Data/ActiveRecord/TActiveRecord.php
+++ b/framework/Data/ActiveRecord/TActiveRecord.php
@@ -133,14 +133,14 @@ Prado::using('System.Data.ActiveRecord.Relations.TActiveRecordRelationContext');
* <code>
* class UserRecord extends TActiveRecord
* {
- * public function table()
+ * public function table()
* {
* return 'users';
* }
*
* }
* </code>
- *
+ *
* @author Wei Zhuo <weizho[at]gmail[dot]com>
* @version $Id$
* @package System.Data.ActiveRecord
@@ -330,6 +330,14 @@ abstract class TActiveRecord extends TComponent
}
/**
+ * @return TDbTableInfo the meta information of the table associated with this AR class.
+ */
+ public function getRecordTableInfo()
+ {
+ return $this->getRecordGateway()->getRecordTableInfo($this);
+ }
+
+ /**
* Compare two records using their primary key values (all column values if
* table does not defined primary keys). The default uses simple == for
* comparison of their values. Set $strict=true for identity comparison (===).
@@ -341,7 +349,7 @@ abstract class TActiveRecord extends TComponent
{
if($record===null || get_class($this)!==get_class($record))
return false;
- $tableInfo = $this->getRecordGateway()->getRecordTableInfo($this);
+ $tableInfo = $this->getRecordTableInfo();
$pks = $tableInfo->getPrimaryKeys();
$properties = count($pks) > 0 ? $pks : $tableInfo->getColumns()->getKeys();
$equals=true;