## Principal

Description

A class for things to do with a Principal

Located in /inc/Principal.php (line 19)

Direct descendents

Class | Description
--- | ---
DAVPrincipal | A class for things to do with a DAV Principal

Variable Summary
boolean $by_email
mixed $collections
mixed $collection_id
mixed $created
mixed $date_format_type
mixed $dav_name
mixed $dead_properties
mixed $default_calendar
mixed $default_privileges
mixed $displayname
mixed $email
mixed $email_ok
boolean $exists
mixed $fullname
mixed $is_addressbook
mixed $is_calendar
mixed $is_principal
mixed $locale
mixed $modified
The $original_request_url
mixed $password
mixed $principal_id
mixed $privileges
mixed $resourcetypes
mixed $type_id
The $url
mixed $username
mixed $user_active
mixed $user_no
Method Summary
static void cacheDelete ( $type, $value)
static void cacheFlush ( $where, [ $whereparams = array()])
static void updateableFields ()
Principal __construct (string $type, mixed $value, [boolean $use_cache = true])
void byEmail ()
void Create ( $field_values)
string dav_name ()
string default_calendar ()
string email ()
void Exists ()
string FetchCollections ()
void FetchDeadProperties ()
void internal_url ([ $type = 'principal'])
string principal_id ()
string setUsername ( $new_username)
void unCache ()
void Update ( $field_values)
string url ([string $type = 'principal'], [boolean $internal = false])
string username ()
int user_no ()
void __get ($property $property)
void __isset ($property $property)
Variables
boolean $by_email (line 92)

Whether this was retrieved using an e-mail address

- access: protected

mixed $collections (line 101)

- access: protected

mixed $collection_id (line 67)

- access: public

mixed $created (line 55)

- access: public

mixed $date_format_type (line 60)

- access: public

mixed $dav_name (line 53)

- access: protected

mixed $dead_properties (line 102)

- access: protected

mixed $default_calendar (line 103)

- access: protected

mixed $default_privileges (line 64)

- access: public

mixed $displayname (line 63)

- access: public

mixed $email (line 52)

- access: protected

mixed $email_ok (line 59)

- access: public

boolean $exists (line 76)

Whether this Principal actually exists in the database yet.

- access: protected

mixed $fullname (line 58)

- access: public

mixed $is_addressbook (line 68)

- access: public

mixed $is_calendar (line 66)

- access: public

mixed $is_principal (line 65)

- access: public

mixed $locale (line 61)

- access: public

mixed $modified (line 56)

- access: public

The $original_request_url (line 86)

- var: actual requested URL for this principal, when the request was for /principals/... or such
- access: protected

mixed $password (line 57)

- access: public

mixed $principal_id (line 51)

- access: protected

mixed $privileges (line 70)

- access: public

mixed $resourcetypes (line 69)

- access: public

mixed $type_id (line 62)

- access: public

The $url (line 81)

- var: home URL of the principal
- access: protected

mixed $username (line 49)

Columns from the database

- access: protected

mixed $user_active (line 54)

- access: public

mixed $user_no (line 50)

- access: protected

Methods
static cacheDelete (line 614)

- access: public

void cacheDelete ( $type, $value)

- $type
- $value

static cacheFlush (line 603)

- access: public

void cacheFlush ( $where, [ $whereparams = array()])

- $where
- $whereparams

static updateableFields (line 30)

- access: public

void updateableFields ()
Constructor __construct (line 122)

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 <em>principal</em>, 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)

- throws: Exception When provided with an invalid $type parameter.

Principal __construct (string $type, mixed $value, [boolean $use_cache = true])

- 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)

Redefined in descendants as:

- DAVPrincipal::__construct() : Constructor

byEmail (line 288)

- access: public

void byEmail ()
Create (line 592)

- access: public

void Create ( $field_values)

- $field_values

dav_name (line 380)

Return the partial path representing this principal

- return: The dav_name

string dav_name ()
default_calendar (line 428)

Return the default calendar for this principal

- return: The internal dav_name for the home_calendar, or false if there is none

string default_calendar ()
email (line 371)

Return the email

- return: The email

string email ()
Exists (line 283)

- access: public

void Exists ()
FetchCollections (line 411)

Fetch the list of collections for this principal

- return: The internal dav_name for the home_calendar, or null if there is none
- access: protected

string FetchCollections ()
FetchDeadProperties (line 394)

Ensure the principal's dead properties are loaded

- access: protected

void FetchDeadProperties ()
internal_url (line 494)

- access: public

void internal_url ([ $type = 'principal'])

- $type

principal_id (line 362)

Return the principal_id

- return: The principal_id

string principal_id ()
setUsername (line 342)

Set the username - but only if the record does not yet exist!

- return: The username

string setUsername ( $new_username)

- $new_username

unCache (line 499)

- access: public

void unCache ()
Update (line 596)

- access: public

void Update ( $field_values)

- $field_values

url (line 468)

Return the URL for this principal

- return: The principal-URL
- access: public

string url ([string $type = 'principal'], [boolean $internal = false])

- string $type: The type of URL we want (the principal, by default)
- boolean $internal: Whether an internal reference is requested

username (line 333)

Return the username

- return: The username

string username ()
user_no (line 353)

Return the user_no

- return: The user_no

int user_no ()
__get (line 251)

This will allow protected properties to be referenced for retrieval, but not referenced for update.

- access: public

void __get ($property $property)

- $property $property

__isset (line 261)

This will allow protected properties to be examined for whether they are set without making them writable. PHP 5.1 or later only.

- access: public

void __isset ($property $property)

- $property $property

Documentation generated on Wed, 04 Jul 2012 10:13:09 +0000 by phpDocumentor 1.4.3