コード例 #1
0
ファイル: OneX.php プロジェクト: mitchlayzell/PHRETS
 public function parse(Session $rets, ResponseInterface $response, $parameters)
 {
     $xml = $response->xml();
     $rs = new Results();
     $rs->setSession($rets)->setResource($parameters['SearchType'])->setClass($parameters['Class']);
     if ($this->getRestrictedIndicator($rets, $xml, $parameters)) {
         $rs->setRestrictedIndicator($this->getRestrictedIndicator($rets, $xml, $parameters));
     }
     $rs->setHeaders($this->getColumnNames($rets, $xml, $parameters));
     $rets->debug(count($rs->getHeaders()) . ' column headers/fields given');
     $this->parseRecords($rets, $xml, $parameters, $rs);
     if ($this->getTotalCount($rets, $xml, $parameters) !== null) {
         $rs->setTotalResultsCount($this->getTotalCount($rets, $xml, $parameters));
         $rets->debug($rs->getTotalResultsCount() . ' total results found');
     }
     $rets->debug($rs->getReturnedResultsCount() . ' results given');
     if ($this->foundMaxRows($rets, $xml, $parameters)) {
         // MAXROWS tag found.  the RETS server withheld records.
         // if the server supports Offset, more requests can be sent to page through results
         // until this tag isn't found anymore.
         $rs->setMaxRowsReached();
         $rets->debug('Maximum rows returned in response');
     }
     unset($xml);
     return $rs;
 }
コード例 #2
0
ファイル: ResultsTest.php プロジェクト: mitchlayzell/PHRETS
 /** @test **/
 public function it_holds_a_session()
 {
     $rs = new Results();
     $rs->setSession('test');
     $this->assertSame('test', $rs->getSession());
 }