Prado\Data\SqlMap\Configuration\TSqlMapXmlConfiguration::configure PHP Метод

configure() публичный Метод

Configure the TSqlMapManager using the given xml file.
public configure ( $filename = null )
    public function configure($filename = null)
    {
        $this->_configFile = $filename;
        $document = $this->loadXmlDocument($filename, $this);
        foreach ($document->xpath('//property') as $property) {
            $this->loadGlobalProperty($property);
        }
        foreach ($document->xpath('//typeHandler') as $handler) {
            $this->loadTypeHandler($handler);
        }
        foreach ($document->xpath('//connection[last()]') as $conn) {
            $this->loadDatabaseConnection($conn);
        }
        //try to load configuration in the current config file.
        $mapping = new TSqlMapXmlMappingConfiguration($this);
        $mapping->configure($filename);
        foreach ($document->xpath('//sqlMap') as $sqlmap) {
            $this->loadSqlMappingFiles($sqlmap);
        }
        $this->resolveResultMapping();
        $this->attachCacheModels();
    }

Usage Example

Пример #1
0
 /**
  * Loads and parses the SqlMap configuration file.
  * @param string xml configuration file.
  */
 public function configureXml($file)
 {
     $config = new TSqlMapXmlConfiguration($this);
     $config->configure($file);
 }