Merge file:///media/external_data/workspace/web/sport-group
[sport-group.git] / library / Zend / Service / Technorati / SearchResultSet.php
blobe51f66670c20a5b9c378af845059538069fcf4fc
1 <?php
2 /**
3 * Zend Framework
5 * LICENSE
7 * This source file is subject to the new BSD license that is bundled
8 * with this package in the file LICENSE.txt.
9 * It is also available through the world-wide-web at this URL:
10 * http://framework.zend.com/license/new-bsd
11 * If you did not receive a copy of the license and are unable to
12 * obtain it through the world-wide-web, please send an email
13 * to license@zend.com so we can send you a copy immediately.
15 * @category Zend
16 * @package Zend_Service
17 * @subpackage Technorati
18 * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
19 * @license http://framework.zend.com/license/new-bsd New BSD License
20 * @version $Id: SearchResultSet.php 16211 2009-06-21 19:23:55Z thomas $
24 /**
25 * @see Zend_Service_Technorati_ResultSet
27 require_once 'Zend/Service/Technorati/ResultSet.php';
30 /**
31 * Represents a Technorati Search query result set.
33 * @category Zend
34 * @package Zend_Service
35 * @subpackage Technorati
36 * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
37 * @license http://framework.zend.com/license/new-bsd New BSD License
39 class Zend_Service_Technorati_SearchResultSet extends Zend_Service_Technorati_ResultSet
41 /**
42 * Number of query results.
44 * @var int
45 * @access protected
47 protected $_queryCount;
49 /**
50 * Parses the search response and retrieve the results for iteration.
52 * @param DomDocument $dom the ReST fragment for this object
53 * @param array $options query options as associative array
55 public function __construct(DomDocument $dom, $options = array())
57 parent::__construct($dom, $options);
59 $result = $this->_xpath->query('/tapi/document/result/querycount/text()');
60 if ($result->length == 1) $this->_queryCount = (int) $result->item(0)->data;
62 $this->_totalResultsReturned = (int) $this->_xpath->evaluate("count(/tapi/document/item)");
63 $this->_totalResultsAvailable = (int) $this->_queryCount;
66 /**
67 * Implements Zend_Service_Technorati_ResultSet::current().
69 * @return Zend_Service_Technorati_SearchResult current result
71 public function current()
73 /**
74 * @see Zend_Service_Technorati_SearchResult
76 require_once 'Zend/Service/Technorati/SearchResult.php';
77 return new Zend_Service_Technorati_SearchResult($this->_results->item($this->_currentIndex));