Example #1
0
 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;
 }
Example #2
0
 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());
     }
 }
Example #3
0
 public static function createCommandContextAsBeginChild($context)
 {
     $obj = new CommandContext($context->getArgs(), $context);
     $obj->asBeginChild();
     return $obj;
 }