Nextras\Orm\Mapper\Dbal\DbalMapper::beginTransaction PHP Метод

beginTransaction() публичный Метод

== Transactions API =============================================================================================
public beginTransaction ( )
    public function beginTransaction()
    {
        $hash = spl_object_hash($this->connection);
        if (!isset(self::$transactions[$hash])) {
            $this->connection->beginTransaction();
            self::$transactions[$hash] = true;
        }
    }

Usage Example

Пример #1
0
 public function remove(IEntity $parent, array $remove)
 {
     if (!$remove) {
         return;
     }
     $this->mapperOne->beginTransaction();
     $list = $this->buildList($parent, $remove);
     $this->connection->query('DELETE FROM %table WHERE %column[] IN %any', $this->joinTable, array_keys(reset($list)), array_map('array_values', $list));
 }