Dotclear 2.24
Loading...
Searching...
No Matches
dcPrefs Class Reference

Public Member Functions

 __construct (string $user_id, ?string $workspace=null)
 
 addWorkspace (string $workspace)
 
 renWorkspace (string $old_workspace, string $new_workspace)
 
 delWorkspace (string $workspace)
 
 get (string $workspace)
 
 __get (string $workspace)
 
 exists (string $workspace)
 
 dumpWorkspaces ()
 

Protected Attributes

 $con
 
 $table
 
 $user_id
 
 $workspaces = []
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( string  $user_id,
?string  $workspace = null 
)

Object constructor. Retrieves user prefs and puts them in $workspaces array. Local (user) prefs have a highest priority than global prefs.

Parameters
string$user_idThe user identifier
string$workspaceThe workspace to load

References $user_id, dcCore\app(), and dcWorkspace\WS_TABLE_NAME.

Member Function Documentation

◆ addWorkspace()

addWorkspace ( string  $workspace)

Create a new workspace. If the workspace already exists, return it without modification.

Parameters
string$workspaceWorkspace name
Returns
dcWorkspace

References exists().

◆ renWorkspace()

renWorkspace ( string  $old_workspace,
string  $new_workspace 
)

Rename a workspace.

Parameters
string$old_workspaceThe old workspace name
string$new_workspaceThe new workspace name
Exceptions
Exception(description)
Returns
bool

References exists(), and dcWorkspace\WS_NAME_SCHEMA.

◆ delWorkspace()

delWorkspace ( string  $workspace)

Delete a whole workspace with all preferences pertaining to it.

Parameters
string$workspaceWorkspace name
Returns
bool

References exists().

◆ get()

get ( string  $workspace)

Returns full workspace with all prefs pertaining to it.

Parameters
string$workspaceWorkspace name
Returns
mixed

References exists().

◆ __get()

__get ( string  $workspace)

Magic __get method.

Returns full workspace with all prefs pertaining to it.

Parameters
string$workspaceWorkspace name
Returns
mixed
Parameters
string$workspaceWorkspace name
Returns
mixed

◆ exists()

exists ( string  $workspace)

Check if a workspace exists

Parameters
string$workspaceWorkspace name
Returns
boolean

Referenced by addWorkspace(), delWorkspace(), get(), and renWorkspace().

◆ dumpWorkspaces()

dumpWorkspaces ( )

Dumps workspaces.

Returns
array

References $workspaces.

Field Documentation

◆ $con

$con
protected

◆ $table

$table
protected

◆ $user_id

$user_id
protected

Referenced by __construct().

◆ $workspaces

$workspaces = []
protected

Referenced by dumpWorkspaces().


The documentation for this class was generated from the following file: