Zend_Gdata_Feed

The Gdata flavor of an Atom Feed.

Defined (1)

The class is defined in the following location(s).

/inc/VideoUploader/includes/Zend/Gdata/Feed.php  
  1. class Zend_Gdata_Feed extends Zend_Gdata_App_Feed 
  2.  
  3. /** 
  4. * The classname for individual feed elements. 
  5. * @var string 
  6. */ 
  7. protected $_entryClassName = 'Zend_Gdata_Entry'; 
  8.  
  9. /** 
  10. * The openSearch:totalResults element 
  11. * @var Zend_Gdata_Extension_OpenSearchTotalResults|null 
  12. */ 
  13. protected $_totalResults = null; 
  14.  
  15. /** 
  16. * The openSearch:startIndex element 
  17. * @var Zend_Gdata_Extension_OpenSearchStartIndex|null 
  18. */ 
  19. protected $_startIndex = null; 
  20.  
  21. /** 
  22. * The openSearch:itemsPerPage element 
  23. * @var Zend_Gdata_Extension_OpenSearchItemsPerPage|null 
  24. */ 
  25. protected $_itemsPerPage = null; 
  26.  
  27. public function __construct($element = null) 
  28. $this->registerAllNamespaces(Zend_Gdata::$namespaces); 
  29. parent::__construct($element); 
  30.  
  31. public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) 
  32. $element = parent::getDOM($doc, $majorVersion, $minorVersion); 
  33. if ($this->_totalResults != null) { 
  34. $element->appendChild($this->_totalResults->getDOM($element->ownerDocument)); 
  35. if ($this->_startIndex != null) { 
  36. $element->appendChild($this->_startIndex->getDOM($element->ownerDocument)); 
  37. if ($this->_itemsPerPage != null) { 
  38. $element->appendChild($this->_itemsPerPage->getDOM($element->ownerDocument)); 
  39.  
  40. // ETags are special. We only support them in protocol >= 2.X. 
  41. // This will be duplicated by the HTTP ETag header. 
  42. if ($majorVersion >= 2) { 
  43. if ($this->_etag != null) { 
  44. $element->setAttributeNS($this->lookupNamespace('gd'),  
  45. 'gd:etag',  
  46. $this->_etag); 
  47.  
  48. return $element; 
  49.  
  50. /** 
  51. * Creates individual Entry objects of the appropriate type and 
  52. * stores them in the $_entry array based upon DOM data. 
  53. * @param DOMNode $child The DOMNode to process 
  54. */ 
  55. protected function takeChildFromDOM($child) 
  56. $absoluteNodeName = $child->namespaceURI . ':' . $child->localName; 
  57. switch ($absoluteNodeName) { 
  58. case $this->lookupNamespace('openSearch') . ':' . 'totalResults': 
  59. $totalResults = new Zend_Gdata_Extension_OpenSearchTotalResults(); 
  60. $totalResults->transferFromDOM($child); 
  61. $this->_totalResults = $totalResults; 
  62. break; 
  63. case $this->lookupNamespace('openSearch') . ':' . 'startIndex': 
  64. $startIndex = new Zend_Gdata_Extension_OpenSearchStartIndex(); 
  65. $startIndex->transferFromDOM($child); 
  66. $this->_startIndex = $startIndex; 
  67. break; 
  68. case $this->lookupNamespace('openSearch') . ':' . 'itemsPerPage': 
  69. $itemsPerPage = new Zend_Gdata_Extension_OpenSearchItemsPerPage(); 
  70. $itemsPerPage->transferFromDOM($child); 
  71. $this->_itemsPerPage = $itemsPerPage; 
  72. break; 
  73. default: 
  74. parent::takeChildFromDOM($child); 
  75. break; 
  76.  
  77. /** 
  78. * Given a DOMNode representing an attribute, tries to map the data into 
  79. * instance members. If no mapping is defined, the name and value are 
  80. * stored in an array. 
  81. * @param DOMNode $attribute The DOMNode attribute needed to be handled 
  82. */ 
  83. protected function takeAttributeFromDOM($attribute) 
  84. switch ($attribute->localName) { 
  85. case 'etag': 
  86. // ETags are special, since they can be conveyed by either the 
  87. // HTTP ETag header or as an XML attribute. 
  88. $etag = $attribute->nodeValue; 
  89. if ($this->_etag === null) { 
  90. $this->_etag = $etag; 
  91. elseif ($this->_etag != $etag) { 
  92. require_once('Zend/Gdata/App/IOException.php'); 
  93. throw new Zend_Gdata_App_IOException("ETag mismatch"); 
  94. break; 
  95. default: 
  96. parent::takeAttributeFromDOM($attribute); 
  97. break; 
  98.  
  99. /** 
  100. * Set the value of the totalResults property. 
  101. * @param Zend_Gdata_Extension_OpenSearchTotalResults|null $value The 
  102. * value of the totalResults property. Use null to unset. 
  103. * @return Zend_Gdata_Feed Provides a fluent interface. 
  104. */ 
  105. function setTotalResults($value) { 
  106. $this->_totalResults = $value; 
  107. return $this; 
  108.  
  109. /** 
  110. * Get the value of the totalResults property. 
  111. * @return Zend_Gdata_Extension_OpenSearchTotalResults|null The value of 
  112. * the totalResults property, or null if unset. 
  113. */ 
  114. function getTotalResults() { 
  115. return $this->_totalResults; 
  116.  
  117. /** 
  118. * Set the start index property for feed paging. 
  119. * @param Zend_Gdata_Extension_OpenSearchStartIndex|null $value The value 
  120. * for the startIndex property. Use null to unset. 
  121. * @return Zend_Gdata_Feed Provides a fluent interface. 
  122. */ 
  123. function setStartIndex($value) { 
  124. $this->_startIndex = $value; 
  125. return $this; 
  126.  
  127. /** 
  128. * Get the value of the startIndex property. 
  129. * @return Zend_Gdata_Extension_OpenSearchStartIndex|null The value of the 
  130. * startIndex property, or null if unset. 
  131. */ 
  132. function getStartIndex() { 
  133. return $this->_startIndex; 
  134.  
  135. /** 
  136. * Set the itemsPerPage property. 
  137. * @param Zend_Gdata_Extension_OpenSearchItemsPerPage|null $value The 
  138. * value for the itemsPerPage property. Use nul to unset. 
  139. * @return Zend_Gdata_Feed Provides a fluent interface. 
  140. */ 
  141. function setItemsPerPage($value) { 
  142. $this->_itemsPerPage = $value; 
  143. return $this; 
  144.  
  145. /** 
  146. * Get the value of the itemsPerPage property. 
  147. * @return Zend_Gdata_Extension_OpenSearchItemsPerPage|null The value of 
  148. * the itemsPerPage property, or null if unset. 
  149. */ 
  150. function getItemsPerPage() { 
  151. return $this->_itemsPerPage; 
  152.