public function Dashboard::isOverriden in Dashboards with Layout Builder 2.0.x
Same name and namespace in other branches
- 8 src/Entity/Dashboard.php \Drupal\dashboards\Entity\Dashboard::isOverriden()
Check if is overriden.
Parameters
\Drupal\Core\Session\AccountInterface $account: Account to check.
Return value
bool True if user data is present.
File
- src/
Entity/ Dashboard.php, line 199
Class
- Dashboard
- Dashboard.
Namespace
Drupal\dashboards\EntityCode
public function isOverriden(AccountInterface $account = NULL) : bool {
if (!$account) {
$account = \Drupal::currentUser();
}
/**
* @var \Drupal\user\UserDataInterface
*/
$dataService = \Drupal::service('user.data');
$data = $dataService
->get('dashboards', $account
->id(), $this
->id());
if ($data && !empty($data)) {
return TRUE;
}
return FALSE;
}