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


PHP PhabricatorEdgeQuery::getDestinationPHIDs方法代码示例

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


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

示例1: loadBloggers

 private function loadBloggers(array $blogs)
 {
     assert_instances_of($blogs, 'PhameBlog');
     $blog_phids = mpull($blogs, 'getPHID');
     $edge_types = array(PhabricatorEdgeConfig::TYPE_BLOG_HAS_BLOGGER);
     $query = new PhabricatorEdgeQuery();
     $query->withSourcePHIDs($blog_phids)->withEdgeTypes($edge_types)->execute();
     $all_blogger_phids = $query->getDestinationPHIDs($blog_phids, $edge_types);
     $handles = id(new PhabricatorObjectHandleData($all_blogger_phids))->loadHandles();
     foreach ($blogs as $blog) {
         $blogger_phids = $query->getDestinationPHIDs(array($blog->getPHID()), $edge_types);
         $blog->attachBloggers(array_select_keys($handles, $blogger_phids));
     }
 }
开发者ID:rudimk,项目名称:phabricator,代码行数:14,代码来源:PhameBlogQuery.php

示例2: newMentionsTab

 private function newMentionsTab(ManiphestTask $task, PhabricatorEdgeQuery $edge_query)
 {
     $in_type = PhabricatorObjectMentionedByObjectEdgeType::EDGECONST;
     $out_type = PhabricatorObjectMentionsObjectEdgeType::EDGECONST;
     $in_phids = $edge_query->getDestinationPHIDs(array(), array($in_type));
     $out_phids = $edge_query->getDestinationPHIDs(array(), array($out_type));
     // Filter out any mentioned users from the list. These are not generally
     // very interesting to show in a relationship summary since they usually
     // end up as subscribers anyway.
     $user_type = PhabricatorPeopleUserPHIDType::TYPECONST;
     foreach ($out_phids as $key => $out_phid) {
         if (phid_get_type($out_phid) == $user_type) {
             unset($out_phids[$key]);
         }
     }
     if (!$in_phids && !$out_phids) {
         return null;
     }
     $viewer = $this->getViewer();
     $in_handles = $viewer->loadHandles($in_phids);
     $out_handles = $viewer->loadHandles($out_phids);
     $in_handles = $this->getCompleteHandles($in_handles);
     $out_handles = $this->getCompleteHandles($out_handles);
     if (!count($in_handles) && !count($out_handles)) {
         return null;
     }
     $view = new PHUIPropertyListView();
     if (count($in_handles)) {
         $view->addProperty(pht('Mentioned In'), $in_handles->renderList());
     }
     if (count($out_handles)) {
         $view->addProperty(pht('Mentioned Here'), $out_handles->renderList());
     }
     return id(new PHUITabView())->setName(pht('Mentions'))->setKey('mentions')->appendChild($view);
 }
开发者ID:NeoArmageddon,项目名称:phabricator,代码行数:35,代码来源:ManiphestTaskDetailController.php


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