Пример #1
0
 public function compile($request)
 {
     $translator = new Translator($this->schema);
     $translatedRequest = $translator->translateIncludingObjects($request);
     $topLevelFunction = self::getTopLevelFunction($request);
     $optimizedRequest = self::optimize($topLevelFunction, $translatedRequest);
     $types = self::getTypes($this->signatures, $optimizedRequest);
     $this->request = $optimizedRequest;
     $this->mysql = new Insert();
     $this->input = new Input();
     if (!$this->enterTable()) {
         return null;
     }
     $this->getFunctionSequence();
     $mysql = $this->mysql->getMysql();
     $formatInput = $this->input->getPhp($types);
     if (!isset($mysql, $formatInput)) {
         return null;
     }
     $phpOutput = '$output = true;';
     return array($mysql, $formatInput, $phpOutput);
 }