summaryrefslogtreecommitdiff
path: root/framework/DataAccess/SQLMap/Configuration/TResultMap.php
diff options
context:
space:
mode:
authorwei <>2006-12-16 03:56:03 +0000
committerwei <>2006-12-16 03:56:03 +0000
commitddc0de38f64e5834ce04f0407a8416172b596655 (patch)
treea94c75b6e7a4f443f748124b84e30d02826bb23a /framework/DataAccess/SQLMap/Configuration/TResultMap.php
parentc8689010d28a0fe2a734131a2964d7df394cdf6c (diff)
removed adodb and framework/DataAccess
Diffstat (limited to 'framework/DataAccess/SQLMap/Configuration/TResultMap.php')
-rw-r--r--framework/DataAccess/SQLMap/Configuration/TResultMap.php83
1 files changed, 0 insertions, 83 deletions
diff --git a/framework/DataAccess/SQLMap/Configuration/TResultMap.php b/framework/DataAccess/SQLMap/Configuration/TResultMap.php
deleted file mode 100644
index b8032c81..00000000
--- a/framework/DataAccess/SQLMap/Configuration/TResultMap.php
+++ /dev/null
@@ -1,83 +0,0 @@
-<?php
-
-class TResultMap extends TComponent
-{
- private $_ID='';
- private $_className='';
- private $_columns='';
- private $_extendMap='';
- private $_groupBy='';
- private $_discriminator=null;
- private $_typeHandlerFactory=null;
-
- public function __construct()
- {
- $this->_columns = new TMap;
- }
-
- public function getID(){ return $this->_ID; }
- public function setID($value){ $this->_ID = $value; }
-
- public function getClass(){ return $this->_className; }
- public function setClass($value){ $this->_className = $value; }
-
- public function getColumns(){ return $this->_columns; }
- public function setColumns($value){ $this->_columns = $value; }
-
- public function getExtends(){ return $this->_extendMap; }
- public function setExtends($value){ $this->_extendMap = $value; }
-
- public function getGroupBy(){ return $this->_groupBy; }
- public function setGroupBy($value){ $this->_groupBy = $value; }
-
- public function getDiscriminator(){ return $this->_discriminator; }
- public function setDiscriminator($value){ $this->_discriminator = $value; }
-
- public function initialize($sqlMap, $resultMap=null)
- {
- $this->_typeHandlerFactory = $sqlMap->getTypeHandlerFactory();
- }
-
- public function addResultProperty(TResultProperty $property)
- {
- $this->_columns->add($property->getProperty(), $property);
- }
-
- public function createInstanceOfResult()
- {
- $handler = $this->_typeHandlerFactory->getTypeHandler($this->getClass());
-
- try
- {
- if(!is_null($handler))
- return $handler->createNewInstance();
- else
- return TTypeHandlerFactory::createInstanceOf($this->getClass());
- }
- catch (TDataMapperException $e)
- {
- throw new TSqlMapExecutionException(
- 'sqlmap_unable_to_create_new_instance',
- $this->getClass(), get_class($handler), $this->getID());
- }
- }
-
- public function resolveSubMap($row)
- {
- $subMap = $this;
- if(!is_null($disc = $this->getDiscriminator()))
- {
- $mapping = $disc->getMapping();
- $dataValue = $mapping->getDatabaseValue($row);
- $subMap = $disc->getSubMap((string)$dataValue);
-
- if(is_null($subMap))
- $subMap = $this;
- else if($subMap !== $this)
- $subMap = $subMap->resolveSubMap($row);
- }
- return $subMap;
- }
-}
-
-?> \ No newline at end of file