public function PriceList::getCustomerRoles in Commerce Pricelist 8.2
Gets the customer roles.
Return value
string[]|null The customer role IDs, or NULL if the price list is not limited to specific customer roles.
Overrides PriceListInterface::getCustomerRoles
File
- src/
Entity/ PriceList.php, line 186
Class
- PriceList
- Defines the Price list entity.
Namespace
Drupal\commerce_pricelist\EntityCode
public function getCustomerRoles() {
$roles = [];
foreach ($this
->get('customer_roles') as $field_item) {
$roles[] = $field_item->target_id;
}
return $roles;
}