本文整理汇总了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;
}