You are here

public function FlexiformFormEntityCommerceOrderUser::getEntity in Flexiform 7

Get the entity for the form.

Return value

A loaded or created entity object ready for use in the form.

Overrides FlexiformFormEntityBase::getEntity

File

includes/form_entity/commerce_order_user.form_entity.inc, line 15
Contains class for a basic entity getter.

Class

FlexiformFormEntityCommerceOrderUser
Form Entity Class for getting users from commerce order.

Code

public function getEntity() {
  parent::getEntity();

  // Get the base order
  $order = $this
    ->getParam('base');

  // Check we have enough information to load the entity.
  if (!$order) {
    return FALSE;
  }
  return entity_load_single('user', $order->uid);
}