mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-09-21 06:20:17 +00:00
New url() and GetProperty() methods matching DAVResource.
Signed-off-by: Andrew McMillan <andrew@morphoss.com>
This commit is contained in:
parent
6328126c04
commit
e5f5f8fc3b
@ -27,7 +27,7 @@ class CalDAVPrincipal
|
|||||||
/**
|
/**
|
||||||
* @var The home URL of the principal
|
* @var The home URL of the principal
|
||||||
*/
|
*/
|
||||||
var $url;
|
private $url;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Identifies whether this principal exists in the DB yet
|
* @var Identifies whether this principal exists in the DB yet
|
||||||
@ -435,6 +435,38 @@ class CalDAVPrincipal
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return an arbitrary property
|
||||||
|
* @return string The name of the arbitrary property
|
||||||
|
*/
|
||||||
|
function GetProperty( $property_id ) {
|
||||||
|
|
||||||
|
switch( $property_id ) {
|
||||||
|
case 'DAV::resource-id':
|
||||||
|
if ( $this->exists && $this->principal_id > 0 )
|
||||||
|
ConstructURL('/.resources/'.$this->principal_id);
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( isset($this->{$property_id}) ) {
|
||||||
|
if ( ! is_object($this->{$property_id}) ) return $this->{$property_id};
|
||||||
|
return clone($this->{$property_id});
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the URL for this principal
|
||||||
|
* @return string The principal-URL, or null if they don't exist
|
||||||
|
*/
|
||||||
|
function url() {
|
||||||
|
return ($this->exists ? $this->url : null );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the calendar_home_set, as lazily as possible
|
* Get the calendar_home_set, as lazily as possible
|
||||||
*/
|
*/
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user