You are here

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

Class

FlexiformFormEntityCurrentUser
Simple form entity for the current user.

Code

public function getEntity() {
  global $user;
  parent::getEntity();
  if ($user->uid == 0) {
    return FALSE;
  }
  return user_load($user->uid);
}