/** * Loads a set of tickets, and cache the result inside the Whups_Reports:: * object to save on database access. * * @param string $type 'open', 'closed', or 'all' - the set of * tickets to fetch. A previously cached set * will be returned if it is available. * @param boolean $expanded List tickets once for each owner of the * ticket? * * @return array The ticket set. */ protected function &_getTicketSet($type, $expanded = false) { $queues = array_keys(Whups::permissionsFilter($this->_backend->getQueues(), 'queue')); $expanded = (int) $expanded; switch ($type) { case 'open': if (is_null($this->_opentickets[$expanded])) { $this->_opentickets[$expanded] = $this->_backend->getTicketsByProperties(array('nores' => true, 'queue' => $queues), true, $expanded); } return $this->_opentickets[$expanded]; case 'closed': if (is_null($this->_closedtickets[$expanded])) { $this->_closedtickets[$expanded] = $this->_backend->getTicketsByProperties(array('res' => true, 'queue' => $queues), true, $expanded); } return $this->_closedtickets[$expanded]; case 'all': if (is_null($this->_alltickets[$expanded])) { $this->_alltickets[$expanded] = $this->_backend->getTicketsByProperties(array('queue' => $queues), true, $expanded); } return $this->_alltickets[$expanded]; } }
/** * Deletes a form reply. * * @param integer $reply A reply ID. * * @throws Whups_Exception */ public function deleteReply($reply) { try { $this->_db->delete('DELETE FROM whups_replies WHERE reply_id = ?', array((int) $reply)); } catch (Horde_Db_Exception $e) { throw new Whups_Exception($e); } parent::deleteReply($reply); }