Пример #1
0
 /**
  * @see ApiBase::execute
  */
 public function execute()
 {
     $parameterFormatter = new ApiRequestParameterFormatter($this->extractRequestParams());
     list($queryString, $parameters, $printouts) = SMWQueryProcessor::getComponentsFromFunctionParams($parameterFormatter->getAskApiParameters(), false);
     $queryResult = $this->getQueryResult($this->getQuery($queryString, $printouts, $parameters));
     $this->addQueryResult($queryResult);
 }
 /**
  * @dataProvider requestAskApiParametersDataProvider
  */
 public function testGetAskApiParameters($parameters, $expected)
 {
     $instance = new ApiRequestParameterFormatter($parameters);
     $result = $instance->getAskApiParameters();
     $this->assertInternalType('array', $result);
     $this->assertEquals($expected, $result);
 }
Пример #3
0
 /**
  * @see ApiBase::execute
  */
 public function execute()
 {
     $parameterFormatter = new ApiRequestParameterFormatter($this->extractRequestParams());
     $outputFormat = 'json';
     $queryResult = $this->getQueryResult($this->getQuery($parameterFormatter->getAskArgsApiParameter('conditions'), $parameterFormatter->getAskArgsApiParameter('printouts'), $parameterFormatter->getAskArgsApiParameter('parameters')));
     if ($this->getMain()->getPrinter() instanceof \ApiFormatXml) {
         $outputFormat = 'xml';
     }
     $this->addQueryResult($queryResult, $outputFormat);
 }
Пример #4
0
 /**
  * @see ApiBase::execute
  */
 public function execute()
 {
     $parameterFormatter = new ApiRequestParameterFormatter($this->extractRequestParams());
     $outputFormat = 'json';
     list($queryString, $parameters, $printouts) = SMWQueryProcessor::getComponentsFromFunctionParams($parameterFormatter->getAskApiParameters(), false);
     $queryResult = $this->getQueryResult($this->getQuery($queryString, $printouts, $parameters));
     if ($this->getMain()->getPrinter() instanceof \ApiFormatXml) {
         $outputFormat = 'xml';
     }
     $this->addQueryResult($queryResult, $outputFormat);
 }
Пример #5
0
 /**
  * @see ApiBase::execute
  */
 public function execute()
 {
     $parameterFormatter = new ApiRequestParameterFormatter($this->extractRequestParams());
     $queryResult = $this->getQueryResult($this->getQuery($parameterFormatter->getAskArgsApiParameter('conditions'), $parameterFormatter->getAskArgsApiParameter('printouts'), $parameterFormatter->getAskArgsApiParameter('parameters')));
     $this->addQueryResult($queryResult);
 }