/zf/library/Zend/Service/Flickr/Result.php

http://github.com/eryx/php-framework-benchmark · PHP · 195 lines · 35 code · 26 blank · 134 comment · 0 complexity · 7d104f78a73c3c243221129040bfe7bd MD5 · raw file

  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 Flickr
  18. * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id: Result.php 23775 2011-03-01 17:25:24Z ralph $
  21. */
  22. /**
  23. * @category Zend
  24. * @package Zend_Service
  25. * @subpackage Flickr
  26. * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
  27. * @license http://framework.zend.com/license/new-bsd New BSD License
  28. */
  29. class Zend_Service_Flickr_Result
  30. {
  31. /**
  32. * The photo's Flickr ID.
  33. *
  34. * @var string
  35. */
  36. public $id;
  37. /**
  38. * The photo owner's NSID.
  39. *
  40. * @var string
  41. */
  42. public $owner;
  43. /**
  44. * A key used in URI construction.
  45. *
  46. * @var string
  47. */
  48. public $secret;
  49. /**
  50. * The servername to use for URI construction.
  51. *
  52. * @var string
  53. */
  54. public $server;
  55. /**
  56. * The photo's title.
  57. *
  58. * @var string
  59. */
  60. public $title;
  61. /**
  62. * Whether the photo is public.
  63. *
  64. * @var string
  65. */
  66. public $ispublic;
  67. /**
  68. * Whether the photo is visible to you because you are a friend of the owner.
  69. *
  70. * @var string
  71. */
  72. public $isfriend;
  73. /**
  74. * Whether the photo is visible to you because you are family of the owner.
  75. *
  76. * @var string
  77. */
  78. public $isfamily;
  79. /**
  80. * The license the photo is available under.
  81. *
  82. * @var string
  83. */
  84. public $license;
  85. /**
  86. * The date the photo was uploaded.
  87. *
  88. * @var string
  89. */
  90. public $dateupload;
  91. /**
  92. * The date the photo was taken.
  93. *
  94. * @var string
  95. */
  96. public $datetaken;
  97. /**
  98. * The screenname of the owner.
  99. *
  100. * @var string
  101. */
  102. public $ownername;
  103. /**
  104. * The server used in assembling icon URLs.
  105. *
  106. * @var string
  107. */
  108. public $iconserver;
  109. /**
  110. * A 75x75 pixel square thumbnail of the image.
  111. *
  112. * @var Zend_Service_Flickr_Image
  113. */
  114. public $Square;
  115. /**
  116. * A 100 pixel thumbnail of the image.
  117. *
  118. * @var Zend_Service_Flickr_Image
  119. */
  120. public $Thumbnail;
  121. /**
  122. * A 240 pixel version of the image.
  123. *
  124. * @var Zend_Service_Flickr_Image
  125. */
  126. public $Small;
  127. /**
  128. * A 500 pixel version of the image.
  129. *
  130. * @var Zend_Service_Flickr_Image
  131. */
  132. public $Medium;
  133. /**
  134. * A 640 pixel version of the image.
  135. *
  136. * @var Zend_Service_Flickr_Image
  137. */
  138. public $Large;
  139. /**
  140. * The original image.
  141. *
  142. * @var Zend_Service_Flickr_Image
  143. */
  144. public $Original;
  145. /**
  146. * Original Zend_Service_Flickr object.
  147. *
  148. * @var Zend_Service_Flickr
  149. */
  150. protected $_flickr;
  151. /**
  152. * Parse the Flickr Result
  153. *
  154. * @param DOMElement $image
  155. * @param Zend_Service_Flickr $flickr Original Zend_Service_Flickr object with which the request was made
  156. * @return void
  157. */
  158. public function __construct(DOMElement $image, Zend_Service_Flickr $flickr)
  159. {
  160. $xpath = new DOMXPath($image->ownerDocument);
  161. foreach ($xpath->query('./@*', $image) as $property) {
  162. $this->{$property->name} = (string) $property->value;
  163. }
  164. $this->_flickr = $flickr;
  165. foreach ($this->_flickr->getImageDetails($this->id) as $k => $v) {
  166. $this->$k = $v;
  167. }
  168. }
  169. }