summaryrefslogtreecommitdiff
path: root/framework/DataAccess/TSQLMap.php
diff options
context:
space:
mode:
authorxue <>2006-04-04 12:28:14 +0000
committerxue <>2006-04-04 12:28:14 +0000
commit1ae61bb24dfd6d86e6c6cd2271af563ff1cc6404 (patch)
tree1ac5f0b94f1e7aca71fe0ebaa0af7d99e48bd555 /framework/DataAccess/TSQLMap.php
parentfe64142d0ce570a843610d15ee8c263c42190199 (diff)
Deleted work that are to be done in 3.1.
Diffstat (limited to 'framework/DataAccess/TSQLMap.php')
-rw-r--r--framework/DataAccess/TSQLMap.php77
1 files changed, 0 insertions, 77 deletions
diff --git a/framework/DataAccess/TSQLMap.php b/framework/DataAccess/TSQLMap.php
deleted file mode 100644
index bc9ba1fb..00000000
--- a/framework/DataAccess/TSQLMap.php
+++ /dev/null
@@ -1,77 +0,0 @@
-<?php
-
-class TSQLMap extends TModule
-{
- private $_SQLMapLibrary='';
- private $_configFile;
- private $_sqlmap;
- private $_provider;
-
- /**
- * File extension of external configuration file
- */
- const CONFIG_FILE_EXT='.config';
-
- public function getSQLMapLibrary()
- {
- if(strlen($this->_SQLMapLibrary) < 1)
- return dirname(__FILE__).'/SQLMap';
- else
- return $this->_SQLMapLibrary;
- }
-
- public function setSQLMapLibrary($path)
- {
- $this->_SQLMapLibrary = Prado::getPathOfNamespace($path);
- }
-
- /**
- * @return string external configuration file. Defaults to null.
- */
- public function getConfigFile()
- {
- return $this->_configFile;
- }
-
- public function init($xml)
- {
- $config = $xml->getElementByTagName('provider');
- $class = $config->getAttribute('class');
- $provider = Prado::createComponent($class);
- $datasource = $config->getElementByTagName('datasource');
- $properties = $datasource->getAttributes();
- foreach($properties as $name=>$value)
- $provider->setSubproperty($name,$value);
- $this->_provider = $provider;
- }
-
- /**
- * @param string external configuration file in namespace format. The file
- * must be suffixed with '.xml'.
- * @throws TInvalidDataValueException if the file is invalid.
- */
- public function setConfigFile($value)
- {
- if(($this->_configFile=Prado::getPathOfNamespace(
- $value,self::CONFIG_FILE_EXT))===null)
- throw new TConfigurationException('sqlmap_configfile_invalid',$value);
- }
-
- protected function configure($configFile)
- {
- include($this->getSQLMapLibrary().'/TSqlMapper.php');
- $builder = new TDomSqlMapBuilder();
- $this->_sqlmap = $builder->configure($configFile);
- if(!is_null($this->_provider))
- $this->_sqlmap->setDataProvider($this->_provider);
- }
-
- public function getClient()
- {
- if(is_null($this->_sqlmap))
- $this->configure($this->getConfigFile());
- return $this->_sqlmap;
- }
-}
-
-?> \ No newline at end of file