Definition at line 19 of file Principal.php.
◆ __construct()
Principal::__construct |
( |
|
$type, |
|
|
|
$value, |
|
|
|
$use_cache = true |
|
) |
| |
Construct a new Principal object. The principal record will be retrieved from the database, or (if not found) initialised to a new record. You can test for whether the Principal exists by calling the Exists() method on the returned object.
Depending on the supplied $type, the following behaviour will occur: path: Will attempt to extract a username or email from the supplied path, and then do what those do. dav_name: Expects the dav_name of a principal, exactly, like: /principal/ and will use that as for username. user_no: Expects an integer which is the usr.user_no (deprecated) principal_id: Expects an integer which is the principal.principal_id email: Will try and retrieve a unique principal by using the email address. Will fail (subsequent call to Exists() will be false) if there is not a unique match. username: Will retrieve based on strtolower($value) = lower(usr.username)
- Parameters
-
string | $type | One of 'path', 'dav_name', 'user_no', 'principal_id', 'email' or 'username' |
mixed | $value | A value appropriate to the $type requested. |
boolean | $use_cache | Whether to use an available cache source (default true) |
- Exceptions
-
Exception | When provided with an invalid $type parameter. |
- Returns
- Principal
There are some values we can construct on the basis of the constructor value.
Definition at line 122 of file Principal.php.
◆ __get()
Principal::__get |
( |
|
$property | ) |
|
This will allow protected properties to be referenced for retrieval, but not referenced for update.
- Parameters
-
Definition at line 254 of file Principal.php.
◆ __isset()
Principal::__isset |
( |
|
$property | ) |
|
This will allow protected properties to be examined for whether they are set without making them writable. PHP 5.1 or later only.
- Parameters
-
Definition at line 264 of file Principal.php.
◆ assignGuestValues()
Principal::assignGuestValues |
( |
| ) |
|
|
private |
◆ assignRowValues()
Principal::assignRowValues |
( |
|
$db_row | ) |
|
|
private |
◆ byEmail()
◆ cacheDelete()
static Principal::cacheDelete |
( |
|
$type, |
|
|
|
$value |
|
) |
| |
|
static |
◆ cacheFlush()
static Principal::cacheFlush |
( |
|
$where, |
|
|
|
$whereparams = array() |
|
) |
| |
|
static |
◆ Create()
Principal::Create |
( |
|
$field_values | ) |
|
◆ dav_name()
Return the partial path representing this principal
- Returns
- string The dav_name
Definition at line 382 of file Principal.php.
◆ default_calendar()
Principal::default_calendar |
( |
| ) |
|
Return the default calendar for this principal
- Returns
- string The internal dav_name for the home_calendar, or false if there is none
Definition at line 430 of file Principal.php.
◆ email()
Return the email
- Returns
- string The email
Definition at line 373 of file Principal.php.
◆ Exists()
◆ FetchCollections()
Principal::FetchCollections |
( |
| ) |
|
|
protected |
Fetch the list of collections for this principal
- Returns
- string The internal dav_name for the home_calendar, or null if there is none
Definition at line 413 of file Principal.php.
◆ FetchDeadProperties()
Principal::FetchDeadProperties |
( |
| ) |
|
|
protected |
Ensure the principal's dead properties are loaded
Definition at line 396 of file Principal.php.
◆ internal_url()
Principal::internal_url |
( |
|
$type = 'principal' | ) |
|
◆ principal_id()
Principal::principal_id |
( |
| ) |
|
Return the principal_id
- Returns
- string The principal_id
Definition at line 364 of file Principal.php.
◆ setUsername()
Principal::setUsername |
( |
|
$new_username | ) |
|
Set the username - but only if the record does not yet exist!
- Returns
- string The username
Definition at line 344 of file Principal.php.
◆ unCache()
◆ Update()
Principal::Update |
( |
|
$field_values | ) |
|
◆ updateableFields()
static Principal::updateableFields |
( |
| ) |
|
|
static |
◆ url()
Principal::url |
( |
|
$type = 'principal' , |
|
|
|
$internal = false |
|
) |
| |
Return the URL for this principal
- Parameters
-
string | $type | The type of URL we want (the principal, by default) |
boolean | $internal | Whether an internal reference is requested |
- Returns
- string The principal-URL
Definition at line 470 of file Principal.php.
◆ user_no()
Return the user_no
- Returns
- int The user_no
Definition at line 355 of file Principal.php.
◆ username()
Return the username
- Returns
- string The username
Definition at line 335 of file Principal.php.
◆ usernameFromPath()
Principal::usernameFromPath |
( |
|
$path | ) |
|
|
private |
Work out the username, based on elements of the path.
- Parameters
-
string | $path | The path to be used. |
Definition at line 300 of file Principal.php.
◆ Write()
Principal::Write |
( |
|
$field_values, |
|
|
|
$inserting = true |
|
) |
| |
|
private |
◆ $by_email
◆ $byEmail
Principal::$byEmail = array() |
|
staticprivate |
◆ $byId
Principal::$byId = array() |
|
staticprivate |
◆ $byUserno
Principal::$byUserno = array() |
|
staticprivate |
◆ $cacheKey
◆ $cacheNs
◆ $collection_id
Principal::$collection_id |
◆ $collections
◆ $created
◆ $date_format_type
Principal::$date_format_type |
◆ $dav_name
◆ $db_mandatory_fields
Principal::$db_mandatory_fields |
|
staticprivate |
◆ $db_tablename
Principal::$db_tablename = 'dav_principal' |
|
staticprivate |
◆ $dead_properties
Principal::$dead_properties |
|
protected |
◆ $default_calendar
Principal::$default_calendar |
|
protected |
◆ $default_privileges
Principal::$default_privileges |
◆ $displayname
◆ $email
◆ $email_ok
◆ $exists
◆ $fullname
◆ $is_addressbook
Principal::$is_addressbook |
◆ $is_calendar
◆ $is_principal
◆ $locale
◆ $modified
◆ $original_request_url
Principal::$original_request_url |
|
protected |
◆ $password
◆ $principal_id
◆ $privileges
◆ $resourcetypes
Principal::$resourcetypes |
◆ $type_id
◆ $url
◆ $user_active
◆ $user_no
◆ $username
The documentation for this class was generated from the following file: