You are here

public function LastTransactionFetch::doExecute in Transaction 8

Gets the last executed transaction.

Parameters

\Drupal\Core\Entity\ContentEntityInterface $target_entity: The target entity.

string $transaction_type_id: The transaction type ID.

File

src/Plugin/RulesAction/LastTransactionFetch.php, line 93

Class

LastTransactionFetch
Provides an action to fetch the last executed transaction of a given target.

Namespace

Drupal\transaction\Plugin\RulesAction

Code

public function doExecute(ContentEntityInterface $target_entity, $transaction_type_id) {
  $transaction = $this->transactionService
    ->getLastExecutedTransaction($target_entity, $transaction_type_id);
  $this
    ->setProvidedValue('transaction_last_executed', $transaction);
}