public function Badge::getBadgeRoleIds in User Badges 8
Gets the Role id associated with Badge.
Return value
integer Role id of role associated with Badge
Overrides BadgeInterface::getBadgeRoleIds
1 call to Badge::getBadgeRoleIds()
- Badge::setBadgeRoleId in src/
Entity/ Badge.php - Sets Role id of Badge.
File
- src/
Entity/ Badge.php, line 93 - Contains \Drupal\user_badges\Entity\Badge.
Class
- Badge
- Defines the Badge entity.
Namespace
Drupal\user_badges\EntityCode
public function getBadgeRoleIds() {
//return $this->get('role_id')->value;
$roles = array();
foreach ($this
->get('role_id') as $role) {
$roles[] = $role->target_id;
}
return $roles;
}