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


PHP Group_member::byMember方法代碼示例

本文整理匯總了PHP中Group_member::byMember方法的典型用法代碼示例。如果您正苦於以下問題:PHP Group_member::byMember方法的具體用法?PHP Group_member::byMember怎麽用?PHP Group_member::byMember使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Group_member的用法示例。


在下文中一共展示了Group_member::byMember方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: atompubPrepare

 protected function atompubPrepare()
 {
     $this->_profile = Profile::getKV('id', $this->trimmed('profile'));
     if (!$this->_profile instanceof Profile) {
         // TRANS: Client exception.
         throw new ClientException(_('No such profile.'), 404);
     }
     $this->_memberships = Group_member::byMember($this->_profile->id, $this->offset, $this->limit);
     return true;
 }
開發者ID:bashrc,項目名稱:gnusocial-debian,代碼行數:10,代碼來源:atompubmembershipfeed.php

示例2: prepare

 /**
  * For initializing members of the class.
  *
  * @param array $argarray misc. arguments
  *
  * @return boolean true
  */
 function prepare($argarray)
 {
     parent::prepare($argarray);
     $profileId = $this->trimmed('profile');
     $this->_profile = Profile::staticGet('id', $profileId);
     if (empty($this->_profile)) {
         // TRANS: Client exception.
         throw new ClientException(_('No such profile.'), 404);
     }
     $offset = ($this->page - 1) * $this->count;
     $limit = $this->count + 1;
     $this->_memberships = Group_member::byMember($this->_profile->id, $offset, $limit);
     return true;
 }
開發者ID:microcosmx,項目名稱:experiments,代碼行數:21,代碼來源:atompubmembershipfeed.php

示例3: dumpGroups

 function dumpGroups($user, $dir)
 {
     common_log(LOG_INFO, 'dumping memberships of ' . $user->nickname . ' to directory ' . $dir);
     $page = 1;
     do {
         $mem = Group_member::byMember($user->id, ($page - 1) * GROUPS_PER_PAGE, GROUPS_PER_PAGE + 1);
         while ($mem->fetch()) {
             try {
                 $fname = $dir . '/' . common_date_iso8601($mem->created) . '-membership-' . $mem->group_id . '.atom';
                 $act = $mem->asActivity();
                 $data = $act->asString(false, false, false);
                 common_log(LOG_INFO, 'dumping membership in ' . $mem->group_id . ' to file ' . $fname);
                 file_put_contents($fname, $data);
                 $data = null;
             } catch (Exception $e) {
                 common_log(LOG_ERR, "Error backing up membership in " . $mem->group_id . ": " . $e->getMessage());
                 continue;
             }
         }
         $page++;
     } while ($mem->N > GROUPS_PER_PAGE);
 }
開發者ID:bashrc,項目名稱:gnusocial-debian,代碼行數:22,代碼來源:offlinebackupqueuehandler.php


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