本文整理汇总了PHP中Family::setvalue方法的典型用法代码示例。如果您正苦于以下问题:PHP Family::setvalue方法的具体用法?PHP Family::setvalue怎么用?PHP Family::setvalue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Family
的用法示例。
在下文中一共展示了Family::setvalue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
function run()
{
// Ref: http://en.wikipedia.org/wiki/VCard
header('Content-type: text/vcf');
header('Content-Disposition: attachment; filename="contacts_' . date('Y-m-d_h:i') . '.vcf"');
$GLOBALS['system']->includeDBClass('person');
$GLOBALS['system']->includeDBClass('family');
$merge_data = $GLOBALS['system']->getDBObjectData('person', array('id' => $_REQUEST['personid']));
$dummy = new Person();
$family = new Family();
foreach ($merge_data as $id => $row) {
$dummy->populate($id, $row);
$family->setvalue('home_tel', $row['home_tel']);
echo "BEGIN:VCARD\n";
echo "VERSION:3.0\n";
echo "N:" . $row['last_name'] . ";" . $row['first_name'] . ";;;\n";
echo "FN:" . $row['first_name'] . " " . $row['last_name'] . "\n";
echo "EMAIL;type=INTERNET;type=HOME:" . $row['email'] . "\n";
echo "ADR;type=HOME:;;" . $row['address_street'] . ";" . $row['address_suburb'] . ";" . $row['address_state'] . ";" . $row['address_postcode'] . ";\n";
echo "TEL;type=HOME:" . $family->getFormattedValue('home_tel') . "\n";
echo "TEL;type=WORK:" . $dummy->getFormattedValue('work_tel') . "\n";
echo "TEL;type=MOBILE:" . $dummy->getFormattedValue('mobile_tel') . "\n";
echo "TEL;type=CELL:" . $dummy->getFormattedValue('mobile_tel') . "\n";
if ($g = $dummy->getValue('Gender')) {
echo "GENDER:" . strtoupper($g[0]) . "\n";
}
echo "CATEGORIES:" . $row['congregation'] . "\n";
echo "ORG:" . $dummy->getFormattedValue('congregationid') . "\n";
echo "NOTES:" . $dummy->getFormattedValue('congregationid') . "\n";
echo "ROLE:" . $dummy->getFormattedValue('status') . "\n";
echo "TITLE:" . $dummy->getFormattedValue('status') . "\n";
echo "SOURCE:" . build_url(array('personid' => array($id))) . "\n";
// where to get vcard from
echo "URL:" . build_url(array('call' => NULL, 'view' => 'persons', 'personid' => $id)) . "\n";
// definitive location for full details
echo "UID:" . build_url(array('call' => NULL, 'view' => 'persons', 'personid' => $id)) . "\n";
echo "END:VCARD\n\n";
}
}