|
1 <?php |
|
2 /** |
|
3 * Zend Framework |
|
4 * |
|
5 * LICENSE |
|
6 * |
|
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. |
|
14 * |
|
15 * @category Zend |
|
16 * @package Zend_Service |
|
17 * @subpackage Technorati |
|
18 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
|
19 * @license http://framework.zend.com/license/new-bsd New BSD License |
|
20 * @version $Id: DailyCountsResult.php 20096 2010-01-06 02:05:09Z bkarwin $ |
|
21 */ |
|
22 |
|
23 |
|
24 /** |
|
25 * @see Zend_Service_Technorati_Result |
|
26 */ |
|
27 require_once 'Zend/Service/Technorati/Result.php'; |
|
28 |
|
29 |
|
30 /** |
|
31 * Represents a single Technorati DailyCounts query result object. |
|
32 * It is never returned as a standalone object, |
|
33 * but it always belongs to a valid Zend_Service_Technorati_DailyCountsResultSet object. |
|
34 * |
|
35 * @category Zend |
|
36 * @package Zend_Service |
|
37 * @subpackage Technorati |
|
38 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
|
39 * @license http://framework.zend.com/license/new-bsd New BSD License |
|
40 */ |
|
41 class Zend_Service_Technorati_DailyCountsResult extends Zend_Service_Technorati_Result |
|
42 { |
|
43 /** |
|
44 * Date of count. |
|
45 * |
|
46 * @var Zend_Date |
|
47 * @access protected |
|
48 */ |
|
49 protected $_date; |
|
50 |
|
51 /** |
|
52 * Number of posts containing query on given date. |
|
53 * |
|
54 * @var int |
|
55 * @access protected |
|
56 */ |
|
57 protected $_count; |
|
58 |
|
59 |
|
60 /** |
|
61 * Constructs a new object object from DOM Document. |
|
62 * |
|
63 * @param DomElement $dom the ReST fragment for this object |
|
64 */ |
|
65 public function __construct(DomElement $dom) |
|
66 { |
|
67 $this->_fields = array( '_date' => 'date', |
|
68 '_count' => 'count'); |
|
69 parent::__construct($dom); |
|
70 |
|
71 // filter fields |
|
72 $this->_date = new Zend_Date(strtotime($this->_date)); |
|
73 $this->_count = (int) $this->_count; |
|
74 } |
|
75 |
|
76 /** |
|
77 * Returns the date of count. |
|
78 * |
|
79 * @return Zend_Date |
|
80 */ |
|
81 public function getDate() { |
|
82 return $this->_date; |
|
83 } |
|
84 |
|
85 /** |
|
86 * Returns the number of posts containing query on given date. |
|
87 * |
|
88 * @return int |
|
89 */ |
|
90 public function getCount() { |
|
91 return $this->_count; |
|
92 } |
|
93 } |