public function lock()
    {
        $result = null;

        $context = $this->getContext();
        $context->table = $this->getBase();

        if ($this->invokeCommand('before.lock', $context) !== false)
        {
            if ($this->isConnected()) {
                $context->result = $this->getDriver()->lock($this->getBase());
            }

            $this->invokeCommand('after.lock', $context);
        }

        return $context->result;
    }