提交一个同步事务

@param Context $context
请求上下文对象
@return $this
544459
public function commit(Context $context = null)
    {
        $this->getDBQueryBuilder($context)->go(null, 'commit');
        return $this;
    }
792644
public function process($context)
    {
        $context->setContents($this->setCDataPlaceholder($context->getContents(), $context->getPlaceholderContainer()));

        return $context->setContents($this->setConditionalCommentsPlaceholder($context->getContents(), $context->getPlaceholderContainer()));
    }
349654
protected function _actionDispatch(AnCommandContext $context)
    {
        if (
            $this->getController()->getIdentifier()->name === 'session' &&
            $this->token != ''
        ) {
            $this->getController()->execute('tokenlogin', $context);
            $context->response->send();
            exit(0);
        }

        return parent::_actionDispatch($context);
    }
962536
public function contextFactory(ContextFactory $instance = null, array $contexts = [])
    {
        if ($instance === null) {
            if ($this->_contextFactory === null) {
                $this->_contextFactory = ContextFactory::createWithDefaults($contexts);
            }

            return $this->_contextFactory;
        }
        $this->_contextFactory = $instance;

        return $this->_contextFactory;
    }
1235748
protected function before(Context $context)
    {
        // set context forwarder
        $context->forwarder = $context->forwarder ?: [$this, 'forward'];

        return parent::before($context);
    }
21493
protected function _actionEdit(AnCommandContext $context)
    {
        $context->response->status = AnHttpResponse::RESET_CONTENT;

        return $this->getItem()->setData($context['data']);
    }
823128
private function configureContext(Context $context)
    {
        foreach ($this->attributes as $key => $value) {
            $context->setAttribute($key, $value);
        }
        if (!empty($this->groups)) {
            $context->setGroups($this->groups);
        }

        if (($context instanceof SerializationContext) && $this->serializeNulls !== null) {
            $context->setSerializeNull($this->serializeNulls);
        }

        if ($this->enableMaxDepthChecks === true) {
            $context->enableMaxDepthChecks();
        }

        if ($this->version !== null) {
            $context->setVersion($this->version);
        }

        return $context;
    }
1296868
protected function initContext($context)
    {
        foreach ($context as $key => &$value) {
            switch (gettype($value)) {
                case 'string':
                case 'integer':
                case 'double':
                    // These types require no conversion
                    break;
                case 'array':
                case 'boolean':
                    $value = json_encode($value);
                    break;
                case 'object':
                    if (method_exists($value, '__toString')) {
                        $value = (string)$value;
                    } else {
                        $value = '[object (' . get_class($value) . ')]';
                    }
                    break;
                case 'NULL':
                    $value = 'NULL';
                    break;
                default:
                    $value = '[' . gettype($value) . ']';
                    break;
            }
        }

        return $context;
    }
512643
protected function _actionAdd($context)
    {
        $data = $context->data;
        $body = $data->body;

        return $this->setItem($this->parent->addComment($body))->getItem();
    }
1077284
protected function _actionBrowse($context)
    {
        if (!$context->query) {
            $context->query = $this->getRepository()->getQuery();
        }

        $query = $context->query;
        $query->order('open', 'DESC');

        if ($this->sort == 'priority') {
            $query->order('priority', 'DESC');
        }

        return parent::_actionBrowse($context);
    }
1187162
protected function before(Context $context)
    {
        // kernel before handler
        $context = parent::before($context);

        // add templater to context
        $context->templater = $this->templater;

        // prepare templater helpers and globals vars
        $this->templater->vars['ctx'] = $context;
        $this->templater->helpers['url'] = [$context, 'url'];
        $this->templater->helpers['call'] = [$context, 'forward'];

        return $context;
    }
878208
public function addContext($context = [])
    {
        if (!$context || empty($context)) {
            return $this;
        }
        $this->nestContext($context);
        $this->sanitizeContext($context);
        $this->context = array_merge($this->context, $context);

        return $this;
    }
639737
protected function _setContext($context)
    {
        $this->context = ($context !== null)
            ? $this->_normalizeContainer($context)
            : null;
    }
1078319
protected function workOnInstance(Context $context)
    {
        $context = $context->setSerializeNull($this->setSerializeNull);

        // group override?
        if (true === $this->overrideHeaderAllowed &&
            $this->requestStack instanceof RequestStack &&
            $this->requestStack->getCurrentRequest() instanceof Request
        ) {
            $headerValue = $this->requestStack->getCurrentRequest()->headers->get($this->overrideHeaderName);
            if (!is_null($headerValue)) {
                $this->groups = array_map('trim', explode(',', $headerValue));
            }
        }

        $serializerGroups = [GroupsExclusionStrategy::DEFAULT_GROUP];
        if (is_array($this->groups) && !empty($this->groups)) {
            $serializerGroups = array_merge($serializerGroups, $this->groups);
        }

        foreach ($this->exclusionStrategies as $strategy) {
            $context->addExclusionStrategy($strategy);
        }

        return $context->setGroups($serializerGroups);
    }
153019
public function createNewFromParent(Context $context, $parent)
    {
        $resource = $this->createNew($context);
        $resource->setParent($parent);
        return $resource;
    }
1054198
public function getContext()
    {
        if (!isset($this->context)) {
            $request = $this->container->get('request');

            $this->context = new RequestContext();
            $this->context->fromRequest($request);
        }

        return $this->context;
    }
294994
public function validate($context = 'payload')
    {
        $args = func_get_args();
        array_shift($args);

        $this->each(function ($claim) use ($context, $args) {
            call_user_func_array(
                [$claim, 'validate'.Str::ucfirst($context)],
                $args
            );
        });

        return $this;
    }