Zend_Gdata_YouTube_Extension_MediaRating

Represents the media:rating element specific to YouTube.

Defined (1)

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

/inc/VideoUploader/includes/Zend/Gdata/YouTube/Extension/MediaRating.php  
  1. class Zend_Gdata_YouTube_Extension_MediaRating extends Zend_Gdata_Extension 
  2.  
  3. protected $_rootElement = 'rating'; 
  4. protected $_rootNamespace = 'media'; 
  5.  
  6. /** 
  7. * @var string 
  8. */ 
  9. protected $_scheme = null; 
  10.  
  11. /** 
  12. * @var string 
  13. */ 
  14. protected $_country = null; 
  15.  
  16. /** 
  17. * Constructs a new MediaRating element 
  18. * @param string $text 
  19. * @param string $scheme 
  20. * @param string $country 
  21. */ 
  22. public function __construct($text = null, $scheme = null, $country = null) 
  23. $this->registerAllNamespaces(Zend_Gdata_Media::$namespaces); 
  24. parent::__construct(); 
  25. $this->_scheme = $scheme; 
  26. $this->_country = $country; 
  27. $this->_text = $text; 
  28.  
  29. /** 
  30. * Retrieves a DOMElement which corresponds to this element and all 
  31. * child properties. This is used to build an entry back into a DOM 
  32. * and eventually XML text for sending to the server upon updates, or 
  33. * for application storage/persistence. 
  34. * @param DOMDocument $doc The DOMDocument used to construct DOMElements 
  35. * @return DOMElement The DOMElement representing this element and all 
  36. * child properties. 
  37. */ 
  38. public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) 
  39. $element = parent::getDOM($doc, $majorVersion, $minorVersion); 
  40. if ($this->_scheme !== null) { 
  41. $element->setAttribute('scheme', $this->_scheme); 
  42. if ($this->_country != null) { 
  43. $element->setAttribute('country', $this->_country); 
  44. return $element; 
  45.  
  46. /** 
  47. * Given a DOMNode representing an attribute, tries to map the data into 
  48. * instance members. If no mapping is defined, the name and value are 
  49. * stored in an array. 
  50. * @param DOMNode $attribute The DOMNode attribute needed to be handled 
  51. */ 
  52. protected function takeAttributeFromDOM($attribute) 
  53. switch ($attribute->localName) { 
  54. case 'scheme': 
  55. $this->_scheme = $attribute->nodeValue; 
  56. break; 
  57. case 'country': 
  58. $this->_country = $attribute->nodeValue; 
  59. break; 
  60. default: 
  61. parent::takeAttributeFromDOM($attribute); 
  62.  
  63. /** 
  64. * @return string 
  65. */ 
  66. public function getScheme() 
  67. return $this->_scheme; 
  68.  
  69. /** 
  70. * @param string $value 
  71. * @return Zend_Gdata_YouTube_Extension_MediaRating Provides a fluent interface 
  72. */ 
  73. public function setScheme($value) 
  74. $this->_scheme = $value; 
  75. return $this; 
  76.  
  77. /** 
  78. * @return string 
  79. */ 
  80. public function getCountry() 
  81. return $this->_country; 
  82.  
  83. /** 
  84. * @param string $value 
  85. * @return Zend_Gdata_YouTube_Extension_MediaRating Provides a fluent interface 
  86. */ 
  87. public function setCountry($value) 
  88. $this->_country = $value; 
  89. return $this; 
  90.  
  91.