You are here

public function Transaction::setOperation in Transaction 8

Sets the transaction operation.

Parameters

string|\Drupal\transaction\TransactionOperationInterface $operation: (optional) The transaction operation config entity or its ID. Defaults to NULL that clears the current value.

Return value

\Drupal\transaction\TransactionInterface The called transaction.

Overrides TransactionInterface::setOperation

File

src/Entity/Transaction.php, line 455

Class

Transaction
Provides the transaction content entity.

Namespace

Drupal\transaction\Entity

Code

public function setOperation($operation = NULL) {
  $this
    ->set('operation', is_string($operation) ? $operation : $operation
    ->id());
  return $this;
}