/** * @static * @return SQLOperatorFactory */ public static function getInstance() { if (!isset(self::$factory)) { self::$factory = new DefaultSQLOperatorFactory(); } return self::$factory; }
protected function prepareExpression(DataControllerCallContext $callcontext, AbstractRequest $request, $datasetName, $columnName, $columnDataType) { $boundaryValue = $this->prepareBoundaryValue($callcontext, $request, $datasetName, $columnName, $columnDataType); $operator = OperatorFactory::getInstance()->initiateHandler(EqualOperatorHandler::$OPERATOR__NAME, $boundaryValue); $sqlOperatorHandler = SQLOperatorFactory::getInstance()->getHandler($this->datasourceHandler, $operator); return $sqlOperatorHandler->format($callcontext, $request, $datasetName, $columnName, $columnDataType); }
protected function getLatestValue(DataControllerCallContext $callcontext, AbstractRequest $request, $datasetName, $columnName) { $latestValue = NULL; if ($this->operatorHandler->wasValueCalculated(self::$OPERATOR_VARIABLE_NAME__LATEST)) { $latestValue = $this->operatorHandler->getCalculatedValue(self::$OPERATOR_VARIABLE_NAME__LATEST); } else { $operator = OperatorFactory::getInstance()->initiateHandler($this->getLatestOperatorName()); $sqlOperatorHandler = SQLOperatorFactory::getInstance()->getHandler($this->datasourceHandler, $operator); $latestValue = $sqlOperatorHandler->prepareBoundaryValue($callcontext, $request, $datasetName, $columnName); // storing into internal cache for further usage $this->operatorHandler->setCalculatedValue(self::$OPERATOR_VARIABLE_NAME__LATEST, $latestValue); } return $latestValue; }
public function formatOperatorValue(DataControllerCallContext $callcontext, AbstractRequest $request, $datasetName, $columnName, OperatorHandler $value) { $handler = SQLOperatorFactory::getInstance()->getHandler($this, $value); return $handler->format($callcontext, $request, $datasetName, $columnName); }