EventStatus.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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_Gdata
  17. * @subpackage Gdata
  18. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id$
  21. */
  22. /**
  23. * @see Zend_Gdata_Extension
  24. */
  25. require_once 'Zend/Gdata/Extension.php';
  26. /**
  27. * Represents the gd:eventStatus element
  28. *
  29. * @category Zend
  30. * @package Zend_Gdata
  31. * @subpackage Gdata
  32. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  33. * @license http://framework.zend.com/license/new-bsd New BSD License
  34. */
  35. class Zend_Gdata_Extension_EventStatus extends Zend_Gdata_Extension
  36. {
  37. protected $_rootElement = 'eventStatus';
  38. protected $_value = null;
  39. public function __construct($value = null)
  40. {
  41. parent::__construct();
  42. $this->_value = $value;
  43. }
  44. public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
  45. {
  46. $element = parent::getDOM($doc, $majorVersion, $minorVersion);
  47. if ($this->_value !== null) {
  48. $element->setAttribute('value', $this->_value);
  49. }
  50. return $element;
  51. }
  52. protected function takeAttributeFromDOM($attribute)
  53. {
  54. switch ($attribute->localName) {
  55. case 'value':
  56. $this->_value = $attribute->nodeValue;
  57. break;
  58. default:
  59. parent::takeAttributeFromDOM($attribute);
  60. }
  61. }
  62. /**
  63. * Get the value for this element's Value attribute.
  64. *
  65. * @return string The requested attribute.
  66. */
  67. public function getValue()
  68. {
  69. return $this->_value;
  70. }
  71. /**
  72. * Set the value for this element's Value attribute.
  73. *
  74. * @param string $value The desired value for this attribute.
  75. * @return Zend_Gdata_Extension_Visibility The element being modified.
  76. */
  77. public function setValue($value)
  78. {
  79. $this->_value = $value;
  80. return $this;
  81. }
  82. /**
  83. * Magic toString method allows using this directly via echo
  84. * Works best in PHP >= 4.2.0
  85. */
  86. public function __toString()
  87. {
  88. return $this->getValue();
  89. }
  90. }