PageRenderTime 41ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/zf/library/Zend/Gdata/Gapps/EmailListRecipientEntry.php

http://github.com/eryx/php-framework-benchmark
PHP | 146 lines | 44 code | 13 blank | 89 comment | 2 complexity | 05854045742aa1fe5f3fc0b7bceab0f6 MD5 | raw file
Possible License(s): MIT, BSD-3-Clause, Apache-2.0, LGPL-2.1, LGPL-3.0, BSD-2-Clause
  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 Gapps
  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: EmailListRecipientEntry.php 23775 2011-03-01 17:25:24Z ralph $
  21. */
  22. /**
  23. * @see Zend_Gdata_Entry
  24. */
  25. require_once 'Zend/Gdata/Entry.php';
  26. /**
  27. * @see Zend_Gdata_Extension_Who
  28. */
  29. require_once 'Zend/Gdata/Extension/Who.php';
  30. /**
  31. * Data model class for a Google Apps Email List Recipient Entry.
  32. *
  33. * Each instance of this class represents a recipient of an email list
  34. * hosted on a Google Apps domain. Each email list may contain multiple
  35. * recipients. Email lists themselves are described by
  36. * Zend_Gdata_EmailListEntry. Multiple recipient entries are contained within
  37. * instances of Zend_Gdata_Gapps_EmailListRecipientFeed.
  38. *
  39. * To transfer email list recipients to and from the Google Apps servers,
  40. * including creating new recipients, refer to the Google Apps service class,
  41. * Zend_Gdata_Gapps.
  42. *
  43. * This class represents <atom:entry> in the Google Data protocol.
  44. *
  45. * @category Zend
  46. * @package Zend_Gdata
  47. * @subpackage Gapps
  48. * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
  49. * @license http://framework.zend.com/license/new-bsd New BSD License
  50. */
  51. class Zend_Gdata_Gapps_EmailListRecipientEntry extends Zend_Gdata_Entry
  52. {
  53. protected $_entryClassName = 'Zend_Gdata_Gapps_EmailListRecipientEntry';
  54. /**
  55. * <gd:who> element used to store the email address of the current
  56. * recipient. Only the email property of this element should be
  57. * populated.
  58. *
  59. * @var Zend_Gdata_Extension_Who
  60. */
  61. protected $_who = null;
  62. /**
  63. * Create a new instance.
  64. *
  65. * @param DOMElement $element (optional) DOMElement from which this
  66. * object should be constructed.
  67. */
  68. public function __construct($element = null)
  69. {
  70. $this->registerAllNamespaces(Zend_Gdata_Gapps::$namespaces);
  71. parent::__construct($element);
  72. }
  73. /**
  74. * Retrieves a DOMElement which corresponds to this element and all
  75. * child properties. This is used to build an entry back into a DOM
  76. * and eventually XML text for application storage/persistence.
  77. *
  78. * @param DOMDocument $doc The DOMDocument used to construct DOMElements
  79. * @return DOMElement The DOMElement representing this element and all
  80. * child properties.
  81. */
  82. public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
  83. {
  84. $element = parent::getDOM($doc, $majorVersion, $minorVersion);
  85. if ($this->_who !== null) {
  86. $element->appendChild($this->_who->getDOM($element->ownerDocument));
  87. }
  88. return $element;
  89. }
  90. /**
  91. * Creates individual Entry objects of the appropriate type and
  92. * stores them as members of this entry based upon DOM data.
  93. *
  94. * @param DOMNode $child The DOMNode to process
  95. */
  96. protected function takeChildFromDOM($child)
  97. {
  98. $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
  99. switch ($absoluteNodeName) {
  100. case $this->lookupNamespace('gd') . ':' . 'who';
  101. $who = new Zend_Gdata_Extension_Who();
  102. $who->transferFromDOM($child);
  103. $this->_who = $who;
  104. break;
  105. default:
  106. parent::takeChildFromDOM($child);
  107. break;
  108. }
  109. }
  110. /**
  111. * Get the value of the who property for this object.
  112. *
  113. * @see setWho
  114. * @return Zend_Gdata_Extension_Who The requested object.
  115. */
  116. public function getWho()
  117. {
  118. return $this->_who;
  119. }
  120. /**
  121. * Set the value of the who property for this object. This property
  122. * is used to store the email address of the current recipient.
  123. *
  124. * @param Zend_Gdata_Extension_Who $value The desired value for this
  125. * instance's who property.
  126. * @return Zend_Gdata_Gapps_EventEntry Provides a fluent interface.
  127. */
  128. public function setWho($value)
  129. {
  130. $this->_who = $value;
  131. return $this;
  132. }
  133. }