diff options
author | wei <> | 2007-04-14 05:02:29 +0000 |
---|---|---|
committer | wei <> | 2007-04-14 05:02:29 +0000 |
commit | 0f0d3c62e608287cdf77f1a3239371b521ecb40b (patch) | |
tree | bd91a9499a946e1667a0e17a9c5a97a9d695c7ce /framework/Data/ActiveRecord/Scaffold/TScaffoldBase.php | |
parent | b05442bbe751b87998d8500ad8e6b28d652a35db (diff) |
Refactor ActiveRecordGateway to use TDataGatewayCommand
Diffstat (limited to 'framework/Data/ActiveRecord/Scaffold/TScaffoldBase.php')
-rw-r--r-- | framework/Data/ActiveRecord/Scaffold/TScaffoldBase.php | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/framework/Data/ActiveRecord/Scaffold/TScaffoldBase.php b/framework/Data/ActiveRecord/Scaffold/TScaffoldBase.php index 266d4346..a9bf2d59 100644 --- a/framework/Data/ActiveRecord/Scaffold/TScaffoldBase.php +++ b/framework/Data/ActiveRecord/Scaffold/TScaffoldBase.php @@ -36,23 +36,15 @@ abstract class TScaffoldBase extends TTemplateControl * @var TActiveRecord record instance (may be new or retrieved from db)
*/
private $_record;
- /**
- * @var TDbMetaData table/view information.
- */
- private $_meta;
/**
* @return TDbMetaData table/view information
*/
- protected function getTableMetaData()
+ protected function getTableInfo()
{
- if($this->_meta===null)
- {
- $finder = $this->getRecordFinder();
- $gateway = $finder->getRecordManager()->getRecordGateWay();
- $this->_meta = $gateway->getMetaData($finder);
- }
- return $this->_meta;
+ $finder = $this->getRecordFinder();
+ $gateway = $finder->getRecordManager()->getRecordGateWay();
+ return $gateway->getRecordTableInfo($finder);
}
/**
@@ -62,7 +54,7 @@ abstract class TScaffoldBase extends TTemplateControl protected function getRecordPropertyValues($record)
{
$data = array();
- foreach($this->getTableMetaData()->getColumns() as $name=>$column)
+ foreach($this->getTableInfo()->getColumns() as $name=>$column)
$data[] = $record->{$name};
return $data;
}
@@ -73,7 +65,7 @@ abstract class TScaffoldBase extends TTemplateControl */
protected function getRecordPkValues($record)
{
- foreach($this->getTableMetaData()->getColumns() as $name=>$column)
+ foreach($this->getTableInfo()->getColumns() as $name=>$column)
{
if($column->getIsPrimaryKey())
$data[] = $record->{$name};
@@ -106,7 +98,6 @@ abstract class TScaffoldBase extends TTemplateControl protected function copyFrom(TScaffoldBase $obj)
{
$this->_record = $obj->_record;
- $this->_meta = $obj->_meta;
$this->setRecordClass($obj->getRecordClass());
}
@@ -116,7 +107,6 @@ abstract class TScaffoldBase extends TTemplateControl protected function clearRecordObject()
{
$this->_record=null;
- $this->_meta=null;
}
/**
|