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