当前位置: 首页>>代码示例>>PHP>>正文


PHP PhabricatorProject::loadAllFromArray方法代码示例

本文整理汇总了PHP中PhabricatorProject::loadAllFromArray方法的典型用法代码示例。如果您正苦于以下问题:PHP PhabricatorProject::loadAllFromArray方法的具体用法?PHP PhabricatorProject::loadAllFromArray怎么用?PHP PhabricatorProject::loadAllFromArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PhabricatorProject的用法示例。


在下文中一共展示了PhabricatorProject::loadAllFromArray方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: loadPage

 public function loadPage()
 {
     $table = new PhabricatorProject();
     $conn_r = $table->establishConnection('r');
     // NOTE: Because visibility checks for projects depend on whether or not
     // the user is a project member, we always load their membership. If we're
     // loading all members anyway we can piggyback on that; otherwise we
     // do an explicit join.
     $select_clause = '';
     if (!$this->needMembers) {
         $select_clause = ', vm.dst viewerIsMember';
     }
     $data = queryfx_all($conn_r, 'SELECT p.* %Q FROM %T p %Q %Q %Q %Q %Q', $select_clause, $table->getTableName(), $this->buildJoinClause($conn_r), $this->buildWhereClause($conn_r), $this->buildGroupClause($conn_r), $this->buildOrderClause($conn_r), $this->buildLimitClause($conn_r));
     $projects = $table->loadAllFromArray($data);
     if ($projects) {
         $viewer_phid = $this->getViewer()->getPHID();
         if ($this->needMembers) {
             $etype = PhabricatorEdgeConfig::TYPE_PROJ_MEMBER;
             $members = id(new PhabricatorEdgeQuery())->withSourcePHIDs(mpull($projects, 'getPHID'))->withEdgeTypes(array($etype))->execute();
             foreach ($projects as $project) {
                 $phid = $project->getPHID();
                 $project->attachMemberPHIDs(array_keys($members[$phid][$etype]));
                 $project->setIsUserMember($viewer_phid, isset($members[$phid][$etype][$viewer_phid]));
             }
         } else {
             foreach ($data as $row) {
                 $projects[$row['id']]->setIsUserMember($viewer_phid, $row['viewerIsMember'] !== null);
             }
         }
     }
     return $projects;
 }
开发者ID:neoxen,项目名称:phabricator,代码行数:32,代码来源:PhabricatorProjectQuery.php


注:本文中的PhabricatorProject::loadAllFromArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。