/** * get all IRC channels associated with an event. The single channel * maps have the keys "id" and "channel". * * @param $event_id - the numeric event id * @param $conn - a PDO connection object * * @returns ( "status" => self::OK, "error" => "", "values" => array(channels) ) on success * and ( "status" => self::ERROR, "error" => "message", "values" => array() ) on failure */ static function get_irc_channels_for_event($event_id, $conn = null) { $conn = $conn ?: Persistence::get_database_object(); $columns = array('id', 'channel'); $table_name = 'irc'; $where = array('postmortem_id' => $event_id, 'deleted' => 0); if (is_null($conn)) { return array("status" => self::ERROR, "error" => "Couldn't get connection object.", "values" => array()); } return Persistence::get_array($columns, $where, $table_name, $conn); }
/** * Get all tags. The tags have the keys "id" and "title" * * @param $conn - a PDO connection object * * @returns ( "status" => self::OK, "error" => "", "values" => array(tags) ) on success * and ( "status" => self::ERROR, "error" => "message", "values" => array() ) on failure */ static function get_tags($conn = null) { $columns = array('id', 'title'); $table_name = 'tags'; $conn = $conn ?: Persistence::get_database_object(); if (is_null($conn)) { return array("status" => self::ERROR, "error" => "Couldn't get connection object.", "values" => array()); } return Persistence::get_array($columns, null, $table_name, $conn); }