You are here

public function Transaction::setExecutor in Transaction 8

Sets the user that executed the transaction.

Parameters

\Drupal\User\UserInterface $user: The executor user.

Return value

\Drupal\transaction\TransactionInterface The called transaction.

Overrides TransactionInterface::setExecutor

File

src/Entity/Transaction.php, line 419

Class

Transaction
Provides the transaction content entity.

Namespace

Drupal\transaction\Entity

Code

public function setExecutor(UserInterface $user) {
  $this
    ->get('executor')
    ->setValue($user
    ->id());
  return $this;
}