public function __construct($feed_array = array(), $extensions = array()) { $version = '1.0'; parent::__construct(); /// we call initialize() later so we don't need to pass feed_array in yet $encoding = 'UTF-8'; // sensible default $dom = $this->dom = new DOMDocument($version, $encoding); $this->setEncoding($encoding); // needed to avoid trying to set encoding to '' $this->context = sfContext::getInstance(); $this->plugin_path = realpath(dirname(__FILE__) . '/../'); $prefix = 'sfDomFeedExtension'; $this->extensions = array(); foreach ($extensions as $extension) { $class_name = $prefix . sfInflector::camelize($extension); $extension = new $class_name(); if (!$extension instanceof sfDomFeedExtension) { throw new sfException("{$class_name} is not a sfDomFeedExtension"); } // unfortunately ^ class_exists() is useless here; it will error instead of exception. $this->extensions[] = $extension; } if ($feed_array) { $this->initialize($feed_array); } if (!$dom->load($this->genTemplatePath(), LIBXML_NOERROR)) { throw new sfDomFeedException("DOMDocument::load failed"); } }
function __construct($object = null, $data_array = null) { parent::__construct($object, $data_array); if (!is_null($object)) { $this->wrapped_object = $object; } }