You are here

public function PriceList::getCustomers in Commerce Pricelist 8.2

Gets the customers.

Return value

\Drupal\user\UserInterface|null The customers user entities, or NULL if the price list is not limited to specific customers.

Overrides PriceListInterface::getCustomers

File

src/Entity/PriceList.php, line 139

Class

PriceList
Defines the Price list entity.

Namespace

Drupal\commerce_pricelist\Entity

Code

public function getCustomers() {
  $customers = [];
  foreach ($this
    ->get('customers') as $field_item) {
    if ($field_item
      ->isEmpty() || !$field_item->entity) {
      continue;
    }
    $customers[] = $field_item->entity;
  }
  return $customers;
}