function TransactionManagerBase::has

Same name in other branches
  1. 11.x core/lib/Drupal/Core/Database/Transaction/TransactionManagerBase.php \Drupal\Core\Database\Transaction\TransactionManagerBase::has()

Overrides TransactionManagerInterface::has

1 call to TransactionManagerBase::has()
TransactionManagerBase::push in core/lib/Drupal/Core/Database/Transaction/TransactionManagerBase.php
Pushes a new Drupal transaction on the stack.

File

core/lib/Drupal/Core/Database/Transaction/TransactionManagerBase.php, line 417

Class

TransactionManagerBase
The database transaction manager base class.

Namespace

Drupal\Core\Database\Transaction

Code

public function has(string $name) : bool {
    foreach ($this->stack() as $item) {
        if ($item->name === $name) {
            return TRUE;
        }
    }
    return FALSE;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.