You are here

public function Job::isAuthor in Translation Management Tool 8

Checks whether the user described by $account is the author of this job.

Parameters

AccountInterface $account: (Optional) A user object. Defaults to the currently logged in user.

Return value

bool TRUE if the passed account is the job owner.

Overrides JobInterface::isAuthor

File

src/Entity/Job.php, line 578

Class

Job
Entity class for the tmgmt_job entity.

Namespace

Drupal\tmgmt\Entity

Code

public function isAuthor(AccountInterface $account = NULL) {
  $account = isset($account) ? $account : \Drupal::currentUser();
  return $this
    ->getOwnerId() == $account
    ->id();
}