public function Transaction::getPrevious in Transaction 8
Get the previous same-type transaction in order of execution.
Return value
\Drupal\transaction\TransactionInterface The previously executed transaction. NULL if this is the first one.
Throws
\Drupal\transaction\InvalidTransactionStateException If the transaction was not executed yet.
Overrides TransactionInterface::getPrevious
File
- src/
Entity/ Transaction.php, line 463
Class
- Transaction
- Provides the transaction content entity.
Namespace
Drupal\transaction\EntityCode
public function getPrevious() {
if ($this
->isPending()) {
throw new InvalidTransactionStateException();
}
return $this
->transactorHandler()
->getPreviousTransaction($this);
}