Пример #1
0
 public function compile($request)
 {
     $topLevelFunction = self::getTopLevelFunction($request);
     $translator = new Translator($this->schema);
     $translatedRequest = $translator->translateIgnoringObjects($request);
     $optimizedRequest = self::optimize($topLevelFunction, $translatedRequest);
     $types = self::getTypes($this->signatures, $optimizedRequest);
     $this->request = $optimizedRequest;
     $this->mysql = new Select();
     $this->subquery = null;
     $this->input = new Input();
     $this->phpOutput = null;
     if (!$this->enterTable($id, $hasZero)) {
         return null;
     }
     $this->getFunctionSequence($topLevelFunction, $id, $hasZero);
     $mysql = $this->mysql->getMysql();
     $phpInput = $this->input->getPhp($types);
     $phpOutput = $this->phpOutput;
     return array($mysql, $phpInput, $phpOutput);
 }
Пример #2
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);
 }