コード例 #1
0
ファイル: InsertCompiler.php プロジェクト: datto/cinnabari
 protected function getFunctionSequence()
 {
     if (!isset($this->request) || count($this->request) !== 1) {
         throw CompilerException::badInsertArgument($this->request);
     }
     $this->request = reset($this->request);
     if (!$this->readInsert()) {
         throw CompilerException::invalidMethodSequence($this->request);
     }
     return true;
 }
コード例 #2
0
ファイル: DeleteCompiler.php プロジェクト: datto/cinnabari
 protected function getFunctionSequence()
 {
     $this->getOptionalFilterFunction();
     $this->getOptionalSortFunction();
     $this->getOptionalSliceFunction();
     $this->request = reset($this->request);
     if (!$this->readDelete()) {
         throw CompilerException::invalidMethodSequence($this->request);
     }
     return true;
 }
コード例 #3
0
ファイル: SetCompiler.php プロジェクト: datto/cinnabari
 protected function getFunctionSequence()
 {
     $this->getOptionalFilterFunction();
     $this->getOptionalSortFunction();
     $this->getOptionalSliceFunction();
     if (!isset($this->request) || count($this->request) !== 1) {
         throw CompilerException::badSetArgument($this->request);
     }
     $this->request = reset($this->request);
     if (!$this->readSet()) {
         throw CompilerException::invalidMethodSequence($this->request);
     }
     return true;
 }
コード例 #4
0
ファイル: GetCompiler.php プロジェクト: datto/cinnabari
 private function getFunctionSequence($topLevelFunction, $id, $hasZero)
 {
     $idAlias = null;
     if ($topLevelFunction === 'get') {
         $idAlias = $this->mysql->addValue($this->context, $id);
     }
     $this->getOptionalFilterFunction();
     $this->getOptionalSortFunction();
     $this->getOptionalSliceFunction();
     if (!isset($this->request) || count($this->request) === 0) {
         throw CompilerException::badGetArgument($this->request);
     }
     if ($this->readFork()) {
         return $this->getFunctionSequence($topLevelFunction, null, null);
     }
     $this->request = reset($this->request);
     if ($this->readGet()) {
         $this->phpOutput = Output::getList($idAlias, $hasZero, true, $this->phpOutput);
         return true;
     }
     if ($this->readCount()) {
         return true;
     }
     if ($this->readParameterizedAggregator($topLevelFunction)) {
         return true;
     }
     throw CompilerException::invalidMethodSequence($this->request);
 }