Example #1
0
 /**
  * Create an exclusive read+write lock on a table
  *
  * @param string $tableName
  * @throws \BadMethodCallException When trying to acquire a second lock
  * @since 9.1.0
  */
 public function lockTable($tableName)
 {
     if ($this->lockedTable !== null) {
         throw new \BadMethodCallException('Can not lock a new table until the previous lock is released.');
     }
     $tableName = $this->tablePrefix . $tableName;
     $this->lockedTable = $tableName;
     $this->adapter->lockTable($tableName);
 }