本文整理匯總了PHP中OC_Calendar_Object::findWhereDAVDataIs方法的典型用法代碼示例。如果您正苦於以下問題:PHP OC_Calendar_Object::findWhereDAVDataIs方法的具體用法?PHP OC_Calendar_Object::findWhereDAVDataIs怎麽用?PHP OC_Calendar_Object::findWhereDAVDataIs使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OC_Calendar_Object
的用法示例。
在下文中一共展示了OC_Calendar_Object::findWhereDAVDataIs方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getCalendarObject
/**
* Returns information from a single calendar object, based on it's object
* uri.
*
* The returned array must have the same keys as getCalendarObjects. The
* 'calendardata' object is required here though, while it's not required
* for getCalendarObjects.
*
* @param string $calendarId
* @param string $objectUri
* @return array
*/
public function getCalendarObject($calendarId, $objectUri)
{
$data = OC_Calendar_Object::findWhereDAVDataIs($calendarId, $objectUri);
if (is_array($data)) {
$object = OC_VObject::parse($data['calendardata']);
$object = OC_Calendar_Object::cleanByAccessClass($data['id'], $object);
$data['calendardata'] = $object->serialize();
$data = $this->OCAddETag($data);
}
return $data;
}
示例2: getCalendarObject
/**
* Returns information from a single calendar object, based on it's object
* uri.
*
* The returned array must have the same keys as getCalendarObjects. The
* 'calendardata' object is required here though, while it's not required
* for getCalendarObjects.
*
* @param string $calendarId
* @param string $objectUri
* @return array
*/
public function getCalendarObject($calendarId, $objectUri)
{
if ($calendarId === 'contact_birthdays') {
$objectUri = substr($objectUri, 0, strlen($objectUri) - 4);
$objectUriArray = explode('::', $objectUri);
if (count($objectUriArray) === 3) {
$app = new \OCA\Contacts\App();
list($backend, $addressBookId, $contactId) = $objectUriArray;
$contact = $app->getContact($backend, $addressBookId, $contactId);
$vevent = $contact->getBirthdayEvent();
if (is_null($vevent)) {
return false;
}
return $this->OCAddETag(array('id' => 0, 'calendarid' => 'contact_birthdays', 'uri' => $contact->getBackend()->name . '::' . $contact->getParent()->getId() . '::' . $contact->getId() . '.ics', 'lastmodified' => $contact->lastModified(), 'calendardata' => $vevent->serialize()));
}
}
$data = OC_Calendar_Object::findWhereDAVDataIs($calendarId, $objectUri);
if (is_array($data)) {
$data = $this->OCAddETag($data);
$object = \Sabre\VObject\Reader::read($data['calendardata']);
if (!$object) {
return false;
}
$object = OC_Calendar_Object::cleanByAccessClass($data['id'], $object);
$data['calendardata'] = $object->serialize();
}
return $data;
}
示例3: getCalendarObject
/**
* Returns information from a single calendar object, based on it's object
* uri.
*
* The returned array must have the same keys as getCalendarObjects. The
* 'calendardata' object is required here though, while it's not required
* for getCalendarObjects.
*
* @param string $calendarId
* @param string $objectUri
* @return array
*/
public function getCalendarObject($calendarId, $objectUri)
{
$data = OC_Calendar_Object::findWhereDAVDataIs($calendarId, $objectUri);
if (is_array($data)) {
$data = $this->OCAddETag($data);
}
return $data;
}