You are here

public function YamlFormSubmission::getOwner in YAML Form 8

Returns the entity owner's user entity.

Return value

\Drupal\user\UserInterface The owner user entity.

Overrides EntityOwnerInterface::getOwner

File

src/Entity/YamlFormSubmission.php, line 447

Class

YamlFormSubmission
Defines the YamlFormSubmission entity.

Namespace

Drupal\yamlform\Entity

Code

public function getOwner() {
  $user = $this
    ->get('uid')->entity;
  if (!$user || $user
    ->isAnonymous()) {
    $user = User::getAnonymousUser();
  }
  return $user;
}