private function getCommandContext($sql, $params) { $rowSql = file_get_contents($this->sqlDir . $sql . '.sql'); $analyzer = new SqlAnalyzer($rowSql); $node = $analyzer->analyze(); $context = CommandContext::createCommandContext($params); $node->acceptContext($context); return $context; }
public function acceptContext($context) { $childContext = CommandContext::createCommandContextAsBeginChild($context); $this->processAcceptingChilden($childContext); if ($childContext->isEnabled()) { $context->addSql($childContext->getSql()); $context->addBindVariables($childContext->getBindVariables()); $context->addBindVariableTypes($childContext->getBindVariableTypes()); } }
public static function createCommandContextAsBeginChild($context) { $obj = new CommandContext($context->getArgs(), $context); $obj->asBeginChild(); return $obj; }