public function EntityBundle::access in Commerce Core 8.2
Same name in this branch
- 8.2 src/Plugin/views/filter/EntityBundle.php \Drupal\commerce\Plugin\views\filter\EntityBundle::access()
- 8.2 src/Plugin/views/field/EntityBundle.php \Drupal\commerce\Plugin\views\field\EntityBundle::access()
Check whether given user has access to this handler.
Parameters
\Drupal\Core\Session\AccountInterface $account: The user account to check.
Return value
bool TRUE if the user has access to the handler, FALSE otherwise.
Overrides HandlerBase::access
File
- src/
Plugin/ views/ filter/ EntityBundle.php, line 55
Class
- EntityBundle
- Filters by entity bundle.
Namespace
Drupal\commerce\Plugin\views\filterCode
public function access(AccountInterface $account) {
$bundles = $this->bundleInfoService
->getBundleInfo($this
->getEntityType());
if ($this->options['expose']['hide_single_bundle'] && count($bundles) <= 1) {
return FALSE;
}
return parent::access($account);
}