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


PHP DatagridConfiguration::isDatasourceSkipAclApply方法代碼示例

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


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

示例1: visitDatasource

 /**
  * {@inheritDoc}
  */
 public function visitDatasource(DatagridConfiguration $config, DatasourceInterface $datasource)
 {
     $defaultPerPage = $config->offsetGetByPath(ToolbarExtension::PAGER_DEFAULT_PER_PAGE_OPTION_PATH, 10);
     if ($datasource instanceof OrmDatasource) {
         $this->pager->setQueryBuilder($datasource->getQueryBuilder());
         $this->pager->setSkipAclCheck($config->isDatasourceSkipAclApply());
         $this->pager->setSkipCountWalker($config->offsetGetByPath(DatagridConfiguration::DATASOURCE_SKIP_COUNT_WALKER_PATH));
     }
     if ($config->offsetGetByPath(ToolbarExtension::PAGER_ONE_PAGE_OPTION_PATH, false) || $config->offsetGetByPath(ModeExtension::MODE_OPTION_PATH) === ModeExtension::MODE_CLIENT) {
         // no restrictions applied
         $this->pager->setPage(0);
         $this->pager->setMaxPerPage(0);
     } else {
         $this->pager->setPage($this->getOr(PagerInterface::PAGE_PARAM, 1));
         $this->pager->setMaxPerPage($this->getOr(PagerInterface::PER_PAGE_PARAM, $defaultPerPage));
     }
     $this->pager->init();
 }
開發者ID:ramunasd,項目名稱:platform,代碼行數:21,代碼來源:OrmPagerExtension.php

示例2: testIsDatasourceSkipAclApply

 /**
  * @param array $params
  * @param bool $expected
  * @dataProvider isDatasourceSkipAclApplyDataProvider
  */
 public function testIsDatasourceSkipAclApply(array $params, $expected)
 {
     $this->configuration->merge($params);
     $this->assertEquals($expected, $this->configuration->isDatasourceSkipAclApply());
 }
開發者ID:ramunasd,項目名稱:platform,代碼行數:10,代碼來源:DatagridConfigurationTest.php

示例3: visitResult

 /**
  * {@inheritdoc}
  */
 public function visitResult(DatagridConfiguration $config, ResultsObject $result)
 {
     $onlyOnePage = !isset($result['options']['totalRecords']) || $result['options']['totalRecords'] === count($result['data']);
     $totalData = [];
     $totals = $config->offsetGetByPath(Configuration::TOTALS_PATH);
     if (null !== $totals && !empty($result['data'])) {
         foreach ($totals as $rowName => $rowConfig) {
             if ($onlyOnePage && $rowConfig[Configuration::TOTALS_HIDE_IF_ONE_PAGE_KEY]) {
                 unset($totals[$rowName]);
                 continue;
             }
             $totalData[$rowName] = $this->getTotalData($rowConfig, $this->getData($result, $rowConfig['columns'], $rowConfig[Configuration::TOTALS_PER_PAGE_ROW_KEY], $config->isDatasourceSkipAclApply()));
         }
     }
     $result->offsetAddToArray('options', ['totals' => $totalData]);
     return $result;
 }
開發者ID:ramunasd,項目名稱:platform,代碼行數:20,代碼來源:OrmTotalsExtension.php


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