All pastes #826899 Raw Edit

Miscellany

public text v1 · immutable
#826899 ·published 2007-12-21 14:32 UTC
rendered paste body
class StoredProcExecutor extends Executor {
	private $rs_;
	
	public function & query($name, $params = null) {
		$this->mdb2_->loadModule('Function');
		
		$this->rs_ = &$this->mdb2_->executeStoredProc($name, $params);
		if (PEAR::isError($this->rs_)) {
			throw new Exception($this->rs_->getMessage(), $this->rs_->getCode());
		}
		return $this->rs_;
	}
	
	public function __destruct() {
		if ($this->rs_ != null)
			$this->rs_->free();
	}
}