Overview

Packages

  • awl
    • caldav-client-v2
    • RRule
  • davical
    • authentication
      • drivers
    • caldav
    • DAViCalSession
    • DAVTicket
    • external-bind
    • feed
    • HTTPAuthSession
    • iSchedule
    • iSchedule-POST
    • logging
    • metrics
    • Principal
    • propfind
    • PublicSession
    • Request
    • Resource
    • tzservice
  • None

Classes

  • DAVPrincipal
  • Principal
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class Principal

A class for things to do with a Principal

Direct known subclasses

DAVPrincipal
Package: davical\Principal
Copyright: Morphoss Ltd http://www.morhposs.com/
License: GNU GPL v2 or later
Author: Andrew McMillan andrew@mcmillan.net.nz
Located at Principal.php
Methods summary
public static
# updateableFields( )
public Principal
# __construct( string $type, mixed $value, boolean $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.

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

$type
One of 'path', 'dav_name', 'user_no', 'principal_id', 'email' or 'username'
$value
A value appropriate to the $type requested.
$use_cache
Whether to use an available cache source (default true)

Returns

Principal

Throws

Exception
When provided with an invalid $type parameter.
public
# __get( $property )

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

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

Parameters

$property
public
# __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.

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

Parameters

$property
public
# Exists( )
public
# byEmail( )
public string
# username( )

Return the username

Return the username

Returns

string
The username
public string
# setUsername( $new_username )

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

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

Returns

string
The username
public integer
# user_no( )

Return the user_no

Return the user_no

Returns

integer
The user_no
public string
# principal_id( )

Return the principal_id

Return the principal_id

Returns

string
The principal_id
public string
# email( )

Return the email

Return the email

Returns

string
The email
public string
# dav_name( )

Return the partial path representing this principal

Return the partial path representing this principal

Returns

string
The dav_name
protected
# FetchDeadProperties( )

Ensure the principal's dead properties are loaded

Ensure the principal's dead properties are loaded

protected string
# FetchCollections( )

Fetch the list of collections for this principal

Fetch the list of collections for this principal

Returns

string
The internal dav_name for the home_calendar, or null if there is none
public string
# default_calendar( )

Return the default calendar for this principal

Return the default calendar for this principal

Returns

string
The internal dav_name for the home_calendar, or false if there is none
public string
# url( string $type = 'principal', boolean $internal = false )

Return the URL for this principal

Return the URL for this principal

Parameters

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

Returns

string
The principal-URL
public
# internal_url( $type = 'principal' )
public
# unCache( )
public
# Create( $field_values )
public
# Update( $field_values )
public static
# cacheFlush( $where, $whereparams = array() )
public static
# cacheDelete( $type, $value )
Properties summary
protected $username

Columns from the database

Columns from the database

#
protected $user_no
#
protected $principal_id
#
protected $email
#
protected $dav_name
#
public $user_active
#
public $created
#
public $modified
#
public $password
#
public $fullname
#
public $email_ok
#
public $date_format_type
#
public $locale
#
public $type_id
#
public $displayname
#
public $default_privileges
#
public $is_principal
#
public $is_calendar
#
public $collection_id
#
public $is_addressbook
#
public $resourcetypes
#
public $privileges
#
protected boolean $exists

Whether this Principal actually exists in the database yet.

Whether this Principal actually exists in the database yet.

#
protected The $url

home URL of the principal

home URL of the principal

#
protected The $original_request_url

actual requested URL for this principal, when the request was for /principals/... or such

actual requested URL for this principal, when the request was for /principals/... or such

#
protected boolean $by_email

Whether this was retrieved using an e-mail address

Whether this was retrieved using an e-mail address

#
protected $collections
#
protected $dead_properties
#
protected $default_calendar
#
DAViCal API documentation generated by ApiGen