8 * This source file is subject to the new BSD license that is bundled
9 * with this package in the file LICENSE.txt.
10 * It is also available through the world-wide-web at this URL:
11 * http://framework.zend.com/license/new-bsd
12 * If you did not receive a copy of the license and are unable to
13 * obtain it through the world-wide-web, please send an email
14 * to license@zend.com so we can send you a copy immediately.
19 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
20 * @license http://framework.zend.com/license/new-bsd New BSD License
25 * @see Zend_Gdata_Entry
27 require_once 'Zend/Gdata/Entry.php';
30 * @see Zend_Gdata_Extension_Who
32 require_once 'Zend/Gdata/Extension/Who.php';
35 * Data model class for a Google Apps Email List Recipient Entry.
37 * Each instance of this class represents a recipient of an email list
38 * hosted on a Google Apps domain. Each email list may contain multiple
39 * recipients. Email lists themselves are described by
40 * Zend_Gdata_EmailListEntry. Multiple recipient entries are contained within
41 * instances of Zend_Gdata_Gapps_EmailListRecipientFeed.
43 * To transfer email list recipients to and from the Google Apps servers,
44 * including creating new recipients, refer to the Google Apps service class,
47 * This class represents <atom:entry> in the Google Data protocol.
52 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
53 * @license http://framework.zend.com/license/new-bsd New BSD License
55 class Zend_Gdata_Gapps_EmailListRecipientEntry extends Zend_Gdata_Entry
58 protected $_entryClassName = 'Zend_Gdata_Gapps_EmailListRecipientEntry';
61 * <gd:who> element used to store the email address of the current
62 * recipient. Only the email property of this element should be
65 * @var Zend_Gdata_Extension_Who
67 protected $_who = null;
70 * Create a new instance.
72 * @param DOMElement $element (optional) DOMElement from which this
73 * object should be constructed.
75 public function __construct($element = null)
77 $this->registerAllNamespaces(Zend_Gdata_Gapps::$namespaces);
78 parent::__construct($element);
82 * Retrieves a DOMElement which corresponds to this element and all
83 * child properties. This is used to build an entry back into a DOM
84 * and eventually XML text for application storage/persistence.
86 * @param DOMDocument $doc The DOMDocument used to construct DOMElements
87 * @return DOMElement The DOMElement representing this element and all
90 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
92 $element = parent::getDOM($doc, $majorVersion, $minorVersion);
93 if ($this->_who !== null) {
94 $element->appendChild($this->_who->getDOM($element->ownerDocument));
100 * Creates individual Entry objects of the appropriate type and
101 * stores them as members of this entry based upon DOM data.
103 * @param DOMNode $child The DOMNode to process
105 protected function takeChildFromDOM($child)
107 $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
109 switch ($absoluteNodeName) {
110 case $this->lookupNamespace('gd') . ':' . 'who';
111 $who = new Zend_Gdata_Extension_Who();
112 $who->transferFromDOM($child);
116 parent::takeChildFromDOM($child);
122 * Get the value of the who property for this object.
125 * @return Zend_Gdata_Extension_Who The requested object.
127 public function getWho()
133 * Set the value of the who property for this object. This property
134 * is used to store the email address of the current recipient.
136 * @param Zend_Gdata_Extension_Who $value The desired value for this
137 * instance's who property.
138 * @return Zend_Gdata_Gapps_EventEntry Provides a fluent interface.
140 public function setWho($value)
142 $this->_who = $value;