public function delete_ticket_cc($ticket_id) { $dao = Model_TicketCc::data_access(); $ticket_cc = $dao->filter(Model_TicketCc::TicketId, $ticket_id); if ($ticket_cc) { return $ticket_cc->delete(); } else { return true; } }
public function get_cc_tickets($username, $limit = false) { $dao = Model_TicketCc::data_access(); $ticket_ids = $dao->filter(Model_TicketCc::CcTo, $username); if ($limit) { $ticket_ids = $ticket_ids->limit(50); } $ticket_ids = $ticket_ids->find(); if (empty($ticket_ids)) { return null; } $ticket_ids_array = array(); foreach ($ticket_ids as $key => $value) { $ticket_ids_array[] = $value->ticket_id; } $tickets = array(); $dao = Model_Ticket::data_access(); $dao->load_field(self::$list_fields); $tickets = $dao->find_by_pks($ticket_ids_array); $tickets = $this->process_tickets_field($tickets); return $tickets; }