public function getCalendarHomeForPrincipal($principalUrl)
    {
        // The default behavior for most sabre/dav servers is that there is a
        // principals root node, which contains users directly under it.
        //
        // This function assumes that there are two components in a principal
        // path. If there's more, we don't return a calendar home. This
        // excludes things like the calendar-proxy-read principal (which it
        // should).
        $parts = explode('/', trim($principalUrl, '/'));
        if (2 !== count($parts)) {
            return;
        }
        if ('principals' !== $parts[0]) {
            return;
        }

        return self::CALENDAR_ROOT.'/'.$parts[1];
    }
public function getCalendarHomeForPrincipal($principalUrl)
    {
        // The default behavior for most sabre/dav servers is that there is a
        // principals root node, which contains users directly under it.
        //
        // This function assumes that there are two components in a principal
        // path. If there's more, we don't return a calendar home. This
        // excludes things like the calendar-proxy-read principal (which it
        // should).
        $parts = explode('/', trim($principalUrl, '/'));
        if (2 !== count($parts)) {
            return;
        }
        if ('principals' !== $parts[0]) {
            return;
        }

        return self::CALENDAR_ROOT.'/'.$parts[1];
    }
public function getCalendarHomeForPrincipal ( $ principalUrl ) { // The default behavior for most sabre/dav servers is that there is a // principals root node, which contains users directly under it. // // This function assumes that there are two components in a principal // path. If there's more, we don't return a calendar home. This // excludes things like the calendar-proxy-read principal (which it // should). $ parts = explode ( '/' , trim ( $ principalUrl , '/' ) ) ; if ( 2 !== count ( $ parts ) ) { return ; } if ( 'principals' !== $ parts [ 0 ] ) { return ; } return self :: CALENDAR_ROOT . '/' . $ parts [ 1 ] ; }
Returns the path to a principal's calendar home.

The return url must not end with a slash.
This function should return null in case a principal did not have
a calendar home.

@param string $principalUrl

@return string
Returns the path to a principal s calendar home .