Static class Fix
This commit is contained in:
@@ -3,19 +3,19 @@ class DashboardManager{
|
||||
public static $devices;
|
||||
|
||||
|
||||
function getAllDashboards ($userId) {
|
||||
static function getAllDashboards ($userId) {
|
||||
return Db::loadAll ("SELECT * FROM dashboard WHERE user_id=?", array($userId));
|
||||
}
|
||||
|
||||
function getAllSubDevices ($userId) {
|
||||
static function getAllSubDevices ($userId) {
|
||||
return Db::loadAll ("SELECT * FROM subdevices WHERE subdevice_id IN (SELECT subdevice_id FROM dashboard WHERE user_id=?)", array($userId));
|
||||
}
|
||||
|
||||
function getSubDevice ($userId, $subDeviceId) {
|
||||
static function getSubDevice ($userId, $subDeviceId) {
|
||||
return Db::loadOne ("SELECT * FROM subdevices WHERE subdevice_id = (SELECT subdevice_id FROM dashboard WHERE user_id=? AND subdevice_id = ? )", array($userId, $subDeviceId));
|
||||
}
|
||||
|
||||
function Add ($subDeviceId) {
|
||||
static function Add ($subDeviceId) {
|
||||
if (self::getSubDevice(UserManager::getUserData('user_id'), $subDeviceId) == null){
|
||||
|
||||
// to do: pokud existuje nepridej
|
||||
@@ -34,7 +34,7 @@ class DashboardManager{
|
||||
}
|
||||
}
|
||||
|
||||
function Remove ($subDeviceId){
|
||||
static function Remove ($subDeviceId){
|
||||
$userId = UserManager::getUserData('user_id');
|
||||
Db::command ('DELETE FROM dashboard WHERE subdevice_id=? AND user_id = ?', array ($subDeviceId, $userId));
|
||||
}
|
||||
|
Reference in New Issue
Block a user