/** * Returns all the settings for the specified domain. * * @param string $domain * Domain name * @throws PDOException * @return array Array of SystemSetting objects */ public function getAllDomain($domain) { try { return AppUtils::dbToArray($this->db->system_setting()->where("domain=?", $domain)->order("settingKey")); } catch (PDOException $e) { throw $e; } }
/** * Returns all user settings for the specified user and domain * * @param string $userId * User ID * @param string $domain * Specific domain of settings i.e. workspace or the settings for a * specific module * @throws PDOException * @return array array of UserSetting objects */ public function getUserSettingsForDomain($userId, $domain) { try { return AppUtils::dbToArray($this->db->user_settings()->where("userId=? AND domain=?", $userId, $domain)); } catch (PDOException $e) { throw $e; } }
/** * Returns a single level of forum file nodes for the specified parent * * @param string $parentId * Parent Node ID * @throws PDOException * @return array Array of Forum File Node objects */ public function getFileNodes($parentId) { try { return AppUtils::dbToArray($this->db->forum_file_node()->where("parentId=?", $parentId)->order('contentType, name')); } catch (PDOException $e) { throw $e; } }
/** * Returns all post entries for the specified forum * * @throws PDOException * @return array Array of Post Template objects */ public function getPostTemplates() { try { return AppUtils::dbToArray($this->db->post_template()->where("category=?", 'General')->order('name asc')); } catch (PDOException $e) { throw $e; } }
public function popTopicEvents($userId, $topic) { try { $events = AppUtils::dbToArray($this->db->event_queue()->where("userId=? AND topic=?", $userId, $topic)); $pdo = getPDO(); $sql = "DELETE FROM event_queue WHERE `userId` = :userId AND `topic` = :topic"; $stmt = $pdo->prepare($sql); $stmt->bindParam(':userId', $userId, PDO::PARAM_STR); $stmt->bindParam(':topic', $topic, PDO::PARAM_STR); $stmt->execute(); return $events; } catch (PDOException $e) { throw $e; } }