public function getConnection() { if (empty($this->connection)) { throw new Phergie_Plugin_Exception('Connection cannot be accessed before one is set', Phergie_Plugin_Exception::ERR_NO_CONNECTION); } return $this->connection; }