public function lockTable($base, $name)
    {
        $query = 'LOCK TABLES '.$this->quoteName($this->getTableNeedle().$base).' WRITE';

        if ($base != $name) {
            $query .= ', '.$this->quoteName($this->getTableNeedle().$name).' READ';
        }

        // Create commandchain context.
        $context = $this->getCommandContext();
        $context->table = $base;
        $context->query = $query;

        if ($this->getCommandChain()->run('before.locktable', $context) !== false) {
            $context->result = $this->execute($context->query, AnDatabase::RESULT_USE);
            $this->getCommandChain()->run('after.locktable', $context);
        }

        return $context->result;
    }
public function lockTable($base, $name)
    {
        $query = 'LOCK TABLES '.$this->quoteName($this->getTableNeedle().$base).' WRITE';

        if ($base != $name) {
            $query .= ', '.$this->quoteName($this->getTableNeedle().$name).' READ';
        }

        // Create commandchain context.
        $context = $this->getCommandContext();
        $context->table = $base;
        $context->query = $query;

        if ($this->getCommandChain()->run('before.locktable', $context) !== false) {
            $context->result = $this->execute($context->query, AnDatabase::RESULT_USE);
            $this->getCommandChain()->run('after.locktable', $context);
        }

        return $context->result;
    }
public function lockTable ( $ base , $ name ) { $ query = 'LOCK TABLES ' . $ this -> quoteName ( $ this -> getTableNeedle ( ) . $ base ) . ' WRITE' ; if ( $ base != $ name ) { $ query .= ', ' . $ this -> quoteName ( $ this -> getTableNeedle ( ) . $ name ) . ' READ' ; } // Create commandchain context. $ context = $ this -> getCommandContext ( ) ; $ context -> table = $ base ; $ context -> query = $ query ; if ( $ this -> getCommandChain ( ) -> run ( 'before.locktable' , $ context ) !== false ) { $ context -> result = $ this -> execute ( $ context -> query , AnDatabase :: RESULT_USE ) ; $ this -> getCommandChain ( ) -> run ( 'after.locktable' , $ context ) ; } return $ context -> result ; }
Lock a table.

@param  string  Base name of the table.
@param  string  Real name of the table.
@return boolean True on success, false otherwise.
Lock a table .