com.woltlab.wcal.core.data.calendar
Data class of calendar. Calendar holds events, has permissions and other settings
DatabaseObject | --Calendar
| Class | Description |
|---|---|
CalendarEditor |
Editor class to edit, delete or add calendars |
| Type | Name |
|---|---|
array<integer> |
$permissions |
| Return | Name |
|---|---|
Calendar |
__construct(integer $calendarID, [array<mixed> $row = null])
|
static integer |
canAddEvent(array<Calendar> $calendars)
|
static array<integer> |
getAccessibleCalendarIDArray([array<integer> $permissions = array()])
|
static array<array> |
getAllCalendarPermissions(integer $calendarID)
|
static array<Calendar> |
getAllCalendars()
|
static array<mixed> |
getCalendarPermissions(mixed $calendarIDs, [User $user = null])
|
static array<Calendar> |
getCalendarsFromUser()
|
static array<Calendar> |
getEnabledCalendars()
|
static array<string> |
getPermissionSettings()
|
static array<Calendar> |
getSubscribedCalendars([integer $limit = 50])
|
static array<User> |
getUsersOfCalendar(Calendar $calendar)
|
boolean |
hasPermission(string $name)
|
integer |
isMarked()
|
boolean |
setPermission(string $name, $value)
|
public array<integer> $permissions = array()
Calendar permissions stored in an associative array ('canEditCalendar' => 1)
public Calendar __construct(integer $calendarID, [array<mixed> $row = null])
Create a new calendar object
$calendarID - id of calendar to create $row - data to create the object Redefinition of: DatabaseObject::__construct()
public static integer canAddEvent(array<Calendar> $calendars)
Convinience method to get to know, if there is at least one calendar where the current user can add events
$calendars - array holding the calendars to be checked public static array<integer> getAccessibleCalendarIDArray([array<integer> $permissions = array()])
Returns a list of ids of all accessible calendars for the active user.
$permissions - permissions to be checked public static array<array> getAllCalendarPermissions(integer $calendarID)
Get all calendar permissions in a form that is needed for the permission control interface
$calendarID - id of calendar to get permissions for public static array<Calendar> getAllCalendars()
Returns a list of all calendars.
public static array<mixed> getCalendarPermissions(mixed $calendarIDs, [User $user = null])
Get the permissions of the given calendar and current user
$calendarIDs - a string of calendar ids separated by comma or a single integer of the one calendar to get permissions for $user - the user you need permissions for public static array<Calendar> getCalendarsFromUser()
Get the calendars created by this user
public static array<Calendar> getEnabledCalendars()
Returns a list of all enabled calendars for the current user.
public static array<string> getPermissionSettings()
Get the permission settings (canAddEvent, canEditEvent, ...)
public static array<Calendar> getSubscribedCalendars([integer $limit = 50])
Get all subscribed calendars that are updated within the last hour
$limit - only the specified maximum of calendars will be returned public static array<User> getUsersOfCalendar(Calendar $calendar)
Get the users that use the given calendar
$calendar - the calendar that is used by the users to return public boolean hasPermission(string $name)
Has the user the specific calendar permission
$name - name of calendar permission public integer isMarked()
Is the calendar marked
public boolean setPermission(string $name, $value)
Has the user the specific calendar permission
$name - name of calendar permission $value DatabaseObject::__construct(), DatabaseObject::handleData(), DatabaseObject::sort(), DatabaseObject::__get()