本文整理汇总了PHP中Property::serialize方法的典型用法代码示例。如果您正苦于以下问题:PHP Property::serialize方法的具体用法?PHP Property::serialize怎么用?PHP Property::serialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Property
的用法示例。
在下文中一共展示了Property::serialize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSerializeUTF8LineFold
public function testSerializeUTF8LineFold()
{
$value = str_repeat('!', 65) . "äbla";
// inserted umlaut-a
$property = new Property('propname', $value);
$expected = "PROPNAME:" . str_repeat('!', 65) . "\r\n äbla\r\n";
$this->assertEquals($expected, $property->serialize());
}
示例2: getLdifProperty
/**
* @brief transform finds the ldif entries associated with the property
* @param Property $property
* @return array|false
*/
public function getLdifProperty($property)
{
$ldifReturn = array();
// Only one value per property, so we loop into types
// then for each one, look into config xml if there are ldif entries matching
$ldifEntries = self::getLdifEntry($property->name, $property['TYPE']);
// If one is found, create a tab entry like tab['ldif_entry']
if ($ldifEntries != null && count($ldifEntries) > 0) {
foreach ($ldifEntries as $ldifEntry) {
if (isset($ldifEntry['unassigned'])) {
if (strcasecmp($property->name, "REV") != 0 && strcasecmp($property->name, "VERSION") != 0 && strcasecmp($property->name, "X-LDAP-DN") != 0) {
// The unassigned properties are set in the ldap unassignedVCardProperty
$ldifReturn[(string) $this->getUnassignedVCardProperty()] = array($property->serialize());
}
} else {
// Last, if the ldif entry has a vcard_position set, take only the value in the position index
$value = $property->value;
if (isset($ldifEntry['vcard_position'])) {
//\OC_Log::write('ldapconnector', __METHOD__." position set ".$ldifEntry['vcard_position'], \OC_Log::DEBUG);
$tmpValues = explode(";", $property->value);
$value = $tmpValues[$ldifEntry['vcard_position']];
}
//\OC_Log::write('ldapconnector', __METHOD__.__METHOD__." entry : ".$ldifEntry['name']." - value : $value", \OC_Log::DEBUG);
// finally, sets tab['ldif_entry'][] with the value
if (strcmp($value, "") != 0) {
if ($ldifEntry['image']) {
$ldifReturn[(string) $ldifEntry['name']] = array(base64_decode($value));
} else {
$ldifReturn[(string) $ldifEntry['name']] = array($value);
}
}
}
}
}
return $ldifReturn;
}