本文整理匯總了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();
}
示例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());
}
示例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;
}