File indexing completed on 2025-03-02 05:29:27

0001 <?php
0002 
0003 /**
0004  * Zend Framework
0005  *
0006  * LICENSE
0007  *
0008  * This source file is subject to the new BSD license that is bundled
0009  * with this package in the file LICENSE.txt.
0010  * It is also available through the world-wide-web at this URL:
0011  * http://framework.zend.com/license/new-bsd
0012  * If you did not receive a copy of the license and are unable to
0013  * obtain it through the world-wide-web, please send an email
0014  * to license@zend.com so we can send you a copy immediately.
0015  *
0016  * @category   Zend
0017  * @package    Zend_Gdata
0018  * @subpackage Gapps
0019  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0020  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0021  * @version    $Id$
0022  */
0023 
0024 /**
0025  * @see Zend_Gdata_Entry
0026  */
0027 // require_once 'Zend/Gdata/Entry.php';
0028 
0029 /**
0030  * @see Zend_Gdata_Extension_Who
0031  */
0032 // require_once 'Zend/Gdata/Extension/Who.php';
0033 
0034 /**
0035  * Data model class for a Google Apps Email List Recipient Entry.
0036  *
0037  * Each instance of this class represents a recipient of an email list
0038  * hosted on a Google Apps domain. Each email list may contain multiple
0039  * recipients. Email lists themselves are described by
0040  * Zend_Gdata_EmailListEntry. Multiple recipient entries are contained within
0041  * instances of Zend_Gdata_Gapps_EmailListRecipientFeed.
0042  *
0043  * To transfer email list recipients to and from the Google Apps servers,
0044  * including creating new recipients, refer to the Google Apps service class,
0045  * Zend_Gdata_Gapps.
0046  *
0047  * This class represents <atom:entry> in the Google Data protocol.
0048  *
0049  * @category   Zend
0050  * @package    Zend_Gdata
0051  * @subpackage Gapps
0052  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0053  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0054  */
0055 class Zend_Gdata_Gapps_EmailListRecipientEntry extends Zend_Gdata_Entry
0056 {
0057 
0058     protected $_entryClassName = 'Zend_Gdata_Gapps_EmailListRecipientEntry';
0059 
0060     /**
0061      * <gd:who> element used to store the email address of the current
0062      * recipient. Only the email property of this element should be
0063      * populated.
0064      *
0065      * @var Zend_Gdata_Extension_Who
0066      */
0067     protected $_who = null;
0068 
0069     /**
0070      * Create a new instance.
0071      *
0072      * @param DOMElement $element (optional) DOMElement from which this
0073      *          object should be constructed.
0074      */
0075     public function __construct($element = null)
0076     {
0077         $this->registerAllNamespaces(Zend_Gdata_Gapps::$namespaces);
0078         parent::__construct($element);
0079     }
0080 
0081     /**
0082      * Retrieves a DOMElement which corresponds to this element and all
0083      * child properties.  This is used to build an entry back into a DOM
0084      * and eventually XML text for application storage/persistence.
0085      *
0086      * @param DOMDocument $doc The DOMDocument used to construct DOMElements
0087      * @return DOMElement The DOMElement representing this element and all
0088      *          child properties.
0089      */
0090     public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
0091     {
0092         $element = parent::getDOM($doc, $majorVersion, $minorVersion);
0093         if ($this->_who !== null) {
0094             $element->appendChild($this->_who->getDOM($element->ownerDocument));
0095         }
0096         return $element;
0097     }
0098 
0099     /**
0100      * Creates individual Entry objects of the appropriate type and
0101      * stores them as members of this entry based upon DOM data.
0102      *
0103      * @param DOMNode $child The DOMNode to process
0104      */
0105     protected function takeChildFromDOM($child)
0106     {
0107         $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
0108 
0109         switch ($absoluteNodeName) {
0110             case $this->lookupNamespace('gd') . ':' . 'who';
0111                 $who = new Zend_Gdata_Extension_Who();
0112                 $who->transferFromDOM($child);
0113                 $this->_who = $who;
0114                 break;
0115             default:
0116                 parent::takeChildFromDOM($child);
0117                 break;
0118         }
0119     }
0120 
0121     /**
0122      * Get the value of the who property for this object.
0123      *
0124      * @see setWho
0125      * @return Zend_Gdata_Extension_Who The requested object.
0126      */
0127     public function getWho()
0128     {
0129         return $this->_who;
0130     }
0131 
0132     /**
0133      * Set the value of the who property for this object. This property
0134      * is used to store the email address of the current recipient.
0135      *
0136      * @param Zend_Gdata_Extension_Who $value The desired value for this
0137      *          instance's who property.
0138      * @return Zend_Gdata_Gapps_EventEntry Provides a fluent interface.
0139      */
0140     public function setWho($value)
0141     {
0142         $this->_who = $value;
0143         return $this;
0144     }
0145 
0146 }