Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
TransactionManager.php
Go to the documentation of this file.
1 <?php
8 
10 
12 {
16  protected $participants;
17 
21  public function start(Connection $connection)
22  {
23  $this->participants[] = $connection;
24  $connection->beginTransaction();
25  return $connection;
26  }
27 
31  public function commit()
32  {
34  while ($connection = array_pop($this->participants)) {
35  $connection->commit();
36  }
37  }
38 
42  public function rollBack()
43  {
45  while ($connection = array_pop($this->participants)) {
46  $connection->rollBack();
47  }
48  }
49 
56  protected function getConnectionKey(Connection $connection)
57  {
58  return spl_object_hash($connection);
59  }
60 }
$connection
Definition: bulk.php:13