本文整理汇总了PHP中ProfileField::getForPID方法的典型用法代码示例。如果您正苦于以下问题:PHP ProfileField::getForPID方法的具体用法?PHP ProfileField::getForPID怎么用?PHP ProfileField::getForPID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProfileField
的用法示例。
在下文中一共展示了ProfileField::getForPID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PlFlagSet
$pid = $row[0];
// Find the address which would be selected as "AX mail"
// But don't update anything
$best_mail = Address::updateBestMail($pid, true);
if (is_null($best_mail)) {
continue;
}
// Just continue if the returned address is already selected
$flags = new PlFlagSet($best_mail['flags']);
if ($flags->hasFlag('dn_best_mail')) {
continue;
}
// The current profile is buggy.
// Let's fetch more data to print detailed information
$profile = Profile::get($pid);
$addresses = ProfileField::getForPID('ProfileAddresses', array($pid), $admin_visibility);
$addresses = $addresses->get(Profile::ADDRESS_POSTAL);
$old_mail = null;
$new_mail = null;
foreach ($addresses as $addr) {
if ($addr->flags->hasFlag('dn_best_mail')) {
$old_mail = $addr;
} else {
if ($addr->id == $best_mail['id']) {
$new_mail = $addr;
}
}
}
echo "Profile " . $profile->hrid() . " ({$pid}) has a wrongly selected best mail.\n";
if (is_null($old_mail)) {
echo "... no currently selected best mail\n";
示例2: getProfileField
/** If not already done, fetches data for the given field
* @param $field One of the Profile::FETCH_*
* @return A ProfileField, or null
*/
private function getProfileField($field)
{
if (!array_key_exists($field, ProfileField::$fields)) {
Platal::page()->kill("Invalid field: {$field}");
}
if ($this->fetched($field)) {
return null;
} else {
$this->fetched_fields = $this->fetched_fields | $field;
}
$cls = ProfileField::$fields[$field];
return ProfileField::getForPID($cls, $this->id(), $this->visibility);
}