/**
	 * Setzt die für Models zu verwendende Factory-Class.
	 * @param string $className
	 */
	public static function setFactoryClass($className){
		if(
			!class_exists($className)
		){
			throw new Dkplus_Model_Exception($className.' is no valid class');
		}
		self::$_factoryClass = $className;
	}
Exemple #2
0
	/**
	 * @param Zend_Db_Table_Row_Abstract $row
	 * @return Dkplus_Model_Row_Interface
	 * @throws Dkplus_Model_Exception if the parameter is not an array or an object.
	 */
	protected function _setRow($data){
		if(
			!is_object($data)
			|| !($data instanceOf Zend_Db_Table_Row_Abstract)
		){
			throw new Dkplus_Model_Exception('First parameter must be an instance of Zend_Db_Table_Row_Abstract.');
		}
		 
		parent::_setRow($data);
		if(
			$this->_data->isReadOnly()
		){
			$this->setReadOnly();
		}
		return $this;
	}
	/**
	 * @param Zend_Db_Table_Row_Abstract $row
	 * @return Dkplus_Model_Row_Interface
	 * @throws Dkplus_Model_Exception if the parameter is not an array or an object.
	 */
	protected function _setRow($data){
		if(
			!is_array($data)
		){
			throw new Dkplus_Model_Exception('First parameter must be an array.');
		}
		 
		parent::_setRow($data);
		if(
			$this->_getModel() instanceOf Dkplus_Model_Excel_Interface
			&& $this->_getModel()->isReadOnly()
		){
			$this->setReadOnly();
		}
		$this->_unsavedData = $this->_data;
		return $this;
	}