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_Gapps_Extension_Property
32 require_once 'Zend/Gdata/Gapps/Extension/Property.php';
35 * Data model class for a Google Apps Member Entry.
37 * Each member entry describes a single member within a Google Apps hosted
40 * To transfer member entries to and from the Google Apps servers, including
41 * creating new entries, refer to the Google Apps service class,
44 * This class represents <atom:entry> in the Google Data protocol.
49 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
50 * @license http://framework.zend.com/license/new-bsd New BSD License
52 class Zend_Gdata_Gapps_MemberEntry extends Zend_Gdata_Entry
55 protected $_entryClassName = 'Zend_Gdata_Gapps_MemberEntry';
58 * <apps:property> element containing information about other items
59 * relevant to this entry.
61 * @var Zend_Gdata_Gapps_Extension_Property
63 protected $_property = array();
66 * Create a new instance.
68 * @param DOMElement $element (optional) DOMElement from which this
69 * object should be constructed.
71 public function __construct($element = null)
73 $this->registerAllNamespaces(Zend_Gdata_Gapps::$namespaces);
74 parent::__construct($element);
78 * Retrieves a DOMElement which corresponds to this element and all
79 * child properties. This is used to build an entry back into a DOM
80 * and eventually XML text for application storage/persistence.
82 * @param DOMDocument $doc The DOMDocument used to construct DOMElements
83 * @return DOMElement The DOMElement representing this element and all
86 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
88 $element = parent::getDOM($doc, $majorVersion, $minorVersion);
90 foreach ($this->_property as $p) {
91 $element->appendChild($p->getDOM($element->ownerDocument));
97 * Creates individual Entry objects of the appropriate type and
98 * stores them as members of this entry based upon DOM data.
100 * @param DOMNode $child The DOMNode to process
102 protected function takeChildFromDOM($child)
104 $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
106 switch ($absoluteNodeName) {
108 case $this->lookupNamespace('apps') . ':' . 'property';
109 $property = new Zend_Gdata_Gapps_Extension_Property();
110 $property->transferFromDOM($child);
111 $this->_property[] = $property;
114 parent::takeChildFromDOM($child);
120 * Returns all property tags for this entry
122 * @param string $rel The rel value of the property to be found. If null,
123 * the array of properties is returned instead.
124 * @return mixed Either an array of Zend_Gdata_Gapps_Extension_Property
125 * objects if $rel is null, a single
126 * Zend_Gdata_Gapps_Extension_Property object if $rel is specified
127 * and a matching feed link is found, or null if $rel is
128 * specified and no matching property is found.
130 public function getProperty($rel = null)
133 return $this->_property;
135 foreach ($this->_property as $p) {
136 if ($p->rel == $rel) {
145 * Set the value of the property property for this object.
147 * @param array $value A collection of
148 * Zend_Gdata_Gapps_Extension_Property objects.
149 * @return Zend_Gdata_Gapps_MemberEntry Provides a fluent interface.
151 public function setProperty($value)
153 $this->_property = $value;