. */ /** * Doctrine_Resource * * @author Konsta Vesterinen * @author Jonathan H. Wage * @package Doctrine * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version $Revision$ * @category Object Relational Mapping * @link www.phpdoctrine.com * @since 1.0 */ class Doctrine_Resource { protected $_config = null; protected $_defaultFormat = 'xml'; public function __construct($config) { foreach ($config as $key => $value) { $this->getConfig()->set($key, $value); } $loadDoctrine = false; foreach ($this->getConfig()->getAll() as $key => $value) { if ($key == 'url') { $this->loadDoctrine = true; } } if (!$this->getConfig()->has('format') OR !$this->getConfig()->get('format')) { $this->getConfig()->set('format', $this->_defaultFormat); } } public function getConfig($key = null) { if ($this->_config === null) { $this->_config = new Doctrine_Resource_Config(); } if ($key === null) { return $this->_config; } else { return $this->_config->get($key); } } }