/** * This function checks if a Level has access to a specific site part. It checks this using * a SQL query on the relationship table (ACCESS_TABLE) * @global DB $db The Database class * @param Level $level This Level object is the Level for which access should be checked * @param string $sajtdel This string should be a sajtdel for which access should be checked. * @return bool True or false depending on access * @see ACCESS_TABLE * @see $sajtDelar */ public static function levelHasAccess($level, $sajtdel) { global $db; if ($db->row("SELECT * FROM " . self::ACCESS_TABLE . " WHERE sajtdel='" . $sajtdel . "' AND levelId=" . $level->getId())) { return true; } else { return false; } }
public function load() { $this->clear(); $level = new Level('College'); $level->save(); print_r(sprintf("Created Level: %s (%s)\n", $level->getName(), $level->getId())); $level = new Level('Summer'); $level->save(); print_r(sprintf("Created Level: %s (%s)\n", $level->getName(), $level->getId())); }