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


PHP PhabricatorSavedQuery类代码示例

本文整理汇总了PHP中PhabricatorSavedQuery的典型用法代码示例。如果您正苦于以下问题:PHP PhabricatorSavedQuery类的具体用法?PHP PhabricatorSavedQuery怎么用?PHP PhabricatorSavedQuery使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: buildSearchForm

 public function buildSearchForm(AphrontFormView $form, PhabricatorSavedQuery $saved)
 {
     $backer_phids = $saved->getParameter('backerPHIDs', array());
     $all_phids = array_mergev(array($backer_phids));
     $handles = id(new PhabricatorHandleQuery())->setViewer($this->requireViewer())->withPHIDs($all_phids)->execute();
     $form->appendChild(id(new AphrontFormTokenizerControl())->setLabel(pht('Backers'))->setName('backers')->setDatasource(new PhabricatorPeopleDatasource())->setValue(array_select_keys($handles, $backer_phids)));
 }
开发者ID:denghp,项目名称:phabricator,代码行数:7,代码来源:FundBackerSearchEngine.php

示例2: buildSearchForm

 public function buildSearchForm(AphrontFormView $form, PhabricatorSavedQuery $saved_query)
 {
     $author_phids = $saved_query->getParameter('authorPHIDs', array());
     $voted = $saved_query->getParameter('voted', false);
     $statuses = $saved_query->getParameter('statuses', array());
     $form->appendControl(id(new AphrontFormTokenizerControl())->setDatasource(new PhabricatorPeopleDatasource())->setName('authors')->setLabel(pht('Authors'))->setValue($author_phids))->appendChild(id(new AphrontFormCheckboxControl())->addCheckbox('voted', 1, pht("Show only polls I've voted in."), $voted))->appendChild(id(new AphrontFormCheckboxControl())->setLabel(pht('Status'))->addCheckbox('statuses[]', 'open', pht('Open'), in_array('open', $statuses))->addCheckbox('statuses[]', 'closed', pht('Closed'), in_array('closed', $statuses)));
 }
开发者ID:kristain,项目名称:phabricator,代码行数:7,代码来源:PhabricatorSlowvoteSearchEngine.php

示例3: buildSearchForm

 public function buildSearchForm(AphrontFormView $form, PhabricatorSavedQuery $saved_query)
 {
     $author_phids = $saved_query->getParameter('authorPHIDs', array());
     $answerer_phids = $saved_query->getParameter('answererPHIDs', array());
     $status = $saved_query->getParameter('status', PonderQuestionStatus::STATUS_OPEN);
     $form->appendControl(id(new AphrontFormTokenizerControl())->setDatasource(new PhabricatorPeopleDatasource())->setName('authors')->setLabel(pht('Authors'))->setValue($author_phids))->appendControl(id(new AphrontFormTokenizerControl())->setDatasource(new PhabricatorPeopleDatasource())->setName('answerers')->setLabel(pht('Answered By'))->setValue($answerer_phids))->appendChild(id(new AphrontFormSelectControl())->setLabel(pht('Status'))->setName('status')->setValue($status)->setOptions(PonderQuestionStatus::getQuestionStatusMap()));
 }
开发者ID:kristain,项目名称:phabricator,代码行数:7,代码来源:PonderQuestionSearchEngine.php

示例4: buildSearchForm

 public function buildSearchForm(AphrontFormView $form, PhabricatorSavedQuery $saved_query)
 {
     $user_phids = $saved_query->getParameter('userPHIDs', array());
     $proj_phids = $saved_query->getParameter('projectPHIDs', array());
     $viewer_projects = $saved_query->getParameter('viewerProjects');
     $form->appendControl(id(new AphrontFormTokenizerControl())->setDatasource(new PhabricatorPeopleDatasource())->setName('users')->setLabel(pht('Include Users'))->setValue($user_phids))->appendControl(id(new AphrontFormTokenizerControl())->setDatasource(new PhabricatorProjectDatasource())->setName('projectPHIDs')->setLabel(pht('Include Projects'))->setValue($proj_phids))->appendChild(id(new AphrontFormCheckboxControl())->addCheckbox('viewerProjects', 1, pht('Include stories about projects I am a member of.'), $viewer_projects));
 }
开发者ID:hrb518,项目名称:phabricator,代码行数:7,代码来源:PhabricatorFeedSearchEngine.php

示例5: loadPage

 protected function loadPage()
 {
     $table = new PhabricatorSavedQuery();
     $conn_r = $table->establishConnection('r');
     $data = queryfx_all($conn_r, 'SELECT * FROM %T %Q %Q %Q', $table->getTableName(), $this->buildWhereClause($conn_r), $this->buildOrderClause($conn_r), $this->buildLimitClause($conn_r));
     return $table->loadAllFromArray($data);
 }
开发者ID:denghp,项目名称:phabricator,代码行数:7,代码来源:PhabricatorSavedQueryQuery.php

示例6: renderResultList

 protected function renderResultList(array $notifications, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($notifications, 'PhabricatorFeedStory');
     $viewer = $this->requireViewer();
     $image = id(new PHUIIconView())->setIconFont('fa-eye-slash');
     $button = id(new PHUIButtonView())->setTag('a')->addSigil('workflow')->setColor(PHUIButtonView::SIMPLE)->setIcon($image)->setText(pht('Mark All Read'));
     switch ($query->getQueryKey()) {
         case 'unread':
             $header = pht('Unread Notifications');
             $no_data = pht('You have no unread notifications.');
             break;
         default:
             $header = pht('Notifications');
             $no_data = pht('You have no notifications.');
             break;
     }
     $clear_uri = id(new PhutilURI('/notification/clear/'));
     if ($notifications) {
         $builder = id(new PhabricatorNotificationBuilder($notifications))->setUser($viewer);
         $view = $builder->buildView();
         $clear_uri->setQueryParam('chronoKey', head($notifications)->getChronologicalKey());
     } else {
         $view = phutil_tag_div('phabricator-notification no-notifications', $no_data);
         $button->setDisabled(true);
     }
     $button->setHref((string) $clear_uri);
     $view = id(new PHUIBoxView())->addPadding(PHUI::PADDING_MEDIUM)->addClass('phabricator-notification-list')->appendChild($view);
     $result = new PhabricatorApplicationSearchResultView();
     $result->addAction($button);
     $result->setContent($view);
     return $result;
 }
开发者ID:patelhardik,项目名称:phabricator,代码行数:32,代码来源:PhabricatorNotificationSearchEngine.php

示例7: buildSearchForm

 public function buildSearchForm(AphrontFormView $form, PhabricatorSavedQuery $saved_query)
 {
     $author_phids = $saved_query->getParameter('authorPHIDs', array());
     $content_type = $saved_query->getParameter('contentType');
     $rule_type = $saved_query->getParameter('ruleType');
     $form->appendControl(id(new AphrontFormTokenizerControl())->setDatasource(new PhabricatorPeopleDatasource())->setName('authors')->setLabel(pht('Authors'))->setValue($author_phids))->appendChild(id(new AphrontFormSelectControl())->setName('contentType')->setLabel(pht('Content Type'))->setValue($content_type)->setOptions($this->getContentTypeOptions()))->appendChild(id(new AphrontFormSelectControl())->setName('ruleType')->setLabel(pht('Rule Type'))->setValue($rule_type)->setOptions($this->getRuleTypeOptions()))->appendChild(id(new AphrontFormSelectControl())->setName('disabled')->setLabel(pht('Rule Status'))->setValue($this->getBoolFromQuery($saved_query, 'disabled'))->setOptions(array('' => pht('Show Enabled and Disabled Rules'), 'false' => pht('Show Only Enabled Rules'), 'true' => pht('Show Only Disabled Rules'))));
 }
开发者ID:kristain,项目名称:phabricator,代码行数:7,代码来源:HeraldRuleSearchEngine.php

示例8: buildSearchForm

 public function buildSearchForm(AphrontFormView $form, PhabricatorSavedQuery $saved_query)
 {
     $phids = $saved_query->getParameter('authorPHIDs', array());
     $author_handles = id(new PhabricatorHandleQuery())->setViewer($this->requireViewer())->withPHIDs($phids)->execute();
     $upcoming = $saved_query->getParameter('upcoming');
     $form->appendChild(id(new AphrontFormTokenizerControl())->setDatasource(new PhabricatorPeopleDatasource())->setName('authors')->setLabel(pht('Authors'))->setValue($author_handles))->appendChild(id(new AphrontFormCheckboxControl())->addCheckbox('upcoming', 1, pht('Show only countdowns that are still counting down.'), $upcoming));
 }
开发者ID:denghp,项目名称:phabricator,代码行数:7,代码来源:PhabricatorCountdownSearchEngine.php

示例9: buildSearchForm

 public function buildSearchForm(AphrontFormView $form, PhabricatorSavedQuery $saved_query)
 {
     $user_phids = $saved_query->getParameter('userPHIDs', array());
     $ended = $saved_query->getParameter('ended', PhrequentUserTimeQuery::ENDED_ALL);
     $order = $saved_query->getParameter('order', PhrequentUserTimeQuery::ORDER_ENDED_DESC);
     $form->appendControl(id(new AphrontFormTokenizerControl())->setDatasource(new PhabricatorPeopleDatasource())->setName('users')->setLabel(pht('Users'))->setValue($user_phids))->appendChild(id(new AphrontFormSelectControl())->setLabel(pht('Ended'))->setName('ended')->setValue($ended)->setOptions(PhrequentUserTimeQuery::getEndedSearchOptions()))->appendChild(id(new AphrontFormSelectControl())->setLabel(pht('Order'))->setName('order')->setValue($order)->setOptions(PhrequentUserTimeQuery::getOrderSearchOptions()));
 }
开发者ID:hrb518,项目名称:phabricator,代码行数:7,代码来源:PhrequentSearchEngine.php

示例10: buildSavedQueryFromRequest

 public function buildSavedQueryFromRequest(AphrontRequest $request)
 {
     $saved = new PhabricatorSavedQuery();
     $saved->setParameter('statuses', $this->readListFromRequest($request, 'statuses'));
     $saved->setParameter('qualities', $this->readListFromRequest($request, 'qualities'));
     return $saved;
 }
开发者ID:patelhardik,项目名称:phabricator,代码行数:7,代码来源:PhabricatorBadgesSearchEngine.php

示例11: buildSearchForm

 public function buildSearchForm(AphrontFormView $form, PhabricatorSavedQuery $saved)
 {
     $form->appendChild(id(new AphrontFormTextControl())->setLabel(pht('Name Contains'))->setName('nameContains')->setValue($saved->getParameter('nameContains')));
     $is_stable = $saved->getParameter('isStable');
     $is_unstable = $saved->getParameter('isUnstable');
     $is_deprecated = $saved->getParameter('isDeprecated');
     $form->appendChild(id(new AphrontFormCheckboxControl())->setLabel('Stability')->addCheckbox('isStable', 1, hsprintf('<strong>%s</strong>: %s', pht('Stable Methods'), pht('Show established API methods with stable interfaces.')), $is_stable)->addCheckbox('isUnstable', 1, hsprintf('<strong>%s</strong>: %s', pht('Unstable Methods'), pht('Show new methods which are subject to change.')), $is_unstable)->addCheckbox('isDeprecated', 1, hsprintf('<strong>%s</strong>: %s', pht('Deprecated Methods'), pht('Show old methods which will be deleted in a future ' . 'version of Phabricator.')), $is_deprecated));
 }
开发者ID:NeoArmageddon,项目名称:phabricator,代码行数:8,代码来源:PhabricatorConduitSearchEngine.php

示例12: buildSearchForm

 public function buildSearchForm(AphrontFormView $form, PhabricatorSavedQuery $saved)
 {
     $auditor_phids = $saved->getParameter('auditorPHIDs', array());
     $commit_author_phids = $saved->getParameter('commitAuthorPHIDs', array());
     $audit_status = $saved->getParameter('auditStatus', null);
     $repository_phids = $saved->getParameter('repositoryPHIDs', array());
     $form->appendControl(id(new AphrontFormTokenizerControl())->setDatasource(new DiffusionAuditorDatasource())->setName('auditorPHIDs')->setLabel(pht('Auditors'))->setValue($auditor_phids))->appendControl(id(new AphrontFormTokenizerControl())->setDatasource(new PhabricatorPeopleDatasource())->setName('authors')->setLabel(pht('Commit Authors'))->setValue($commit_author_phids))->appendChild(id(new AphrontFormSelectControl())->setName('auditStatus')->setLabel(pht('Audit Status'))->setOptions($this->getAuditStatusOptions())->setValue($audit_status))->appendControl(id(new AphrontFormTokenizerControl())->setLabel(pht('Repositories'))->setName('repositoryPHIDs')->setDatasource(new DiffusionRepositoryDatasource())->setValue($repository_phids));
 }
开发者ID:fengshao0907,项目名称:phabricator,代码行数:8,代码来源:PhabricatorCommitSearchEngine.php

示例13: buildSearchForm

 public function buildSearchForm(AphrontFormView $form, PhabricatorSavedQuery $saved_query)
 {
     $phids = $saved_query->getParameter('authorPHIDs', array());
     $author_handles = id(new PhabricatorHandleQuery())->setViewer($this->requireViewer())->withPHIDs($phids)->execute();
     $explicit = $saved_query->getParameter('explicit');
     $form->appendChild(id(new AphrontFormTokenizerControl())->setDatasource(new PhabricatorPeopleDatasource())->setName('authors')->setLabel(pht('Authors'))->setValue($author_handles))->appendChild(id(new AphrontFormCheckboxControl())->addCheckbox('explicit', 1, pht('Show only manually uploaded files.'), $explicit));
     $this->buildDateRange($form, $saved_query, 'createdStart', pht('Created After'), 'createdEnd', pht('Created Before'));
 }
开发者ID:denghp,项目名称:phabricator,代码行数:8,代码来源:PhabricatorFileSearchEngine.php

示例14: applyConstraintsToQuery

 public function applyConstraintsToQuery($object, $query, PhabricatorSavedQuery $saved, array $map)
 {
     $engine = $this->getSearchEngine();
     $fields = $this->getCustomFields($object);
     foreach ($fields as $field) {
         $field->applyApplicationSearchConstraintToQuery($engine, $query, $saved->getParameter('custom:' . $field->getFieldIndex()));
     }
 }
开发者ID:pugong,项目名称:phabricator,代码行数:8,代码来源:PhabricatorCustomFieldSearchEngineExtension.php

示例15: buildSearchForm

 public function buildSearchForm(AphrontFormView $form, PhabricatorSavedQuery $saved_query)
 {
     $phids = $saved_query->getParameter('authorPHIDs', array());
     $author_handles = id(new PhabricatorHandleQuery())->setViewer($this->requireViewer())->withPHIDs($phids)->execute();
     $statuses = array('' => pht('Any Status'), 'closed' => pht('Closed'), 'open' => pht('Open'));
     $status = $saved_query->getParameter('statuses', array());
     $status = head($status);
     $form->appendChild(id(new AphrontFormTokenizerControl())->setDatasource(new PhabricatorPeopleDatasource())->setName('authors')->setLabel(pht('Authors'))->setValue($author_handles))->appendChild(id(new AphrontFormSelectControl())->setLabel(pht('Status'))->setName('status')->setOptions($statuses)->setValue($status));
 }
开发者ID:denghp,项目名称:phabricator,代码行数:9,代码来源:PholioMockSearchEngine.php


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