public function Job::isAuthor

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 584

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();
}