当前位置: 首页>>代码示例>>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;未经允许,请勿转载。