public function lockTable($table)
    {
        $query = 'LOCK TABLES '.$this->quoteIdentifier($this->getTableNeedle().$table).' WRITE';

        // Create command chain context.
        $context = $this->getContext();
        $context->table = $table;
        $context->query = $query;

        if($this->invokeCommand('before.lock', $context) !== false)
        {
            $context->result = $this->execute($context->query, KDatabase::RESULT_USE);
            $this->invokeCommand('after.lock', $context);
        }

        return $context->result;
    }