當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ProfileField::getForPID方法代碼示例

本文整理匯總了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";
開發者ID:Ekleog,項目名稱:platal,代碼行數:31,代碼來源:bestmail.check.php

示例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);
 }
開發者ID:Ekleog,項目名稱:platal,代碼行數:17,代碼來源:profile.php


注:本文中的ProfileField::getForPID方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。