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_Exif
32 require_once 'Zend/Gdata/Exif.php';
35 * @see Zend_Gdata_Exif_Extension_Tags
37 require_once 'Zend/Gdata/Exif/Extension/Tags.php';
40 * An Atom entry containing EXIF metadata.
45 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
46 * @license http://framework.zend.com/license/new-bsd New BSD License
48 class Zend_Gdata_Exif_Entry extends Zend_Gdata_Entry
51 * The classname for individual feed elements.
55 protected $_entryClassName = 'Zend_Gdata_Exif_Entry';
58 * The tags that belong to the Exif group.
62 protected $_tags = null;
65 * Create a new instance.
67 * @param DOMElement $element (optional) DOMElement from which this
68 * object should be constructed.
70 public function __construct($element = null)
72 $this->registerAllNamespaces(Zend_Gdata_Exif::$namespaces);
73 parent::__construct($element);
77 * Retrieves a DOMElement which corresponds to this element and all
78 * child properties. This is used to build an entry back into a DOM
79 * and eventually XML text for sending to the server upon updates, or
80 * 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);
89 if ($this->_tags != null) {
90 $element->appendChild($this->_tags->getDOM($element->ownerDocument));
96 * Creates individual Entry objects of the appropriate type and
97 * stores them as members of this entry based upon DOM data.
99 * @param DOMNode $child The DOMNode to process
101 protected function takeChildFromDOM($child)
103 $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
104 switch ($absoluteNodeName) {
105 case $this->lookupNamespace('exif') . ':' . 'tags':
106 $tags = new Zend_Gdata_Exif_Extension_Tags();
107 $tags->transferFromDOM($child);
108 $this->_tags = $tags;
111 parent::takeChildFromDOM($child);
117 * Retrieve the tags for this entry.
120 * @return Zend_Gdata_Exif_Extension_Tags The requested object
121 * or null if not set.
123 public function getTags()
129 * Set the tags property for this entry. This property contains
132 * This corresponds to the <exif:tags> property in the Google Data
135 * @param Zend_Gdata_Exif_Extension_Tags $value The desired value
136 * this element, or null to unset.
137 * @return Zend_Gdata_Exif_Entry Provides a fluent interface
139 public function setTags($value)
141 $this->_tags = $value;