You are here

public function FlexiformFormEntityPartyFromUser::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/party_from_user.form_entity.inc, line 15
Contains class for a basic entity getter.

Class

FlexiformFormEntityPartyFromUser
Form entity to get the party from a user.

Code

public function getEntity() {
  parent::getEntity();
  $settings = $this->settings;

  // Get the party entity.
  $user = $this
    ->getParam('user');
  if ($user) {
    return party_user_get_party($user);
  }
  return FALSE;
}