public function PriceList::getCustomer in Commerce Pricelist 8.2
Gets the customer.
Return value
\Drupal\user\UserInterface|null The customer user entity, or NULL if the price list is not limited to a specific customer.
Overrides PriceListInterface::getCustomer
Deprecated
in commerce_pricelist:8.x-2.0 and is removed from commerce_pricelist:8.x-3.0. Use $this->getCustomers() instead.
See also
https://www.drupal.org/project/commerce_pricelist/issues/3171289
File
- src/
Entity/ PriceList.php, line 129
Class
- PriceList
- Defines the Price list entity.
Namespace
Drupal\commerce_pricelist\EntityCode
public function getCustomer() {
if ($this
->get('customers')
->isEmpty()) {
return NULL;
}
return $this
->get('customers')
->get(0)->entity;
}