[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 Exif
|
---|
| 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_Exif
|
---|
| 30 | */
|
---|
| 31 | require_once 'Zend/Gdata/Exif.php';
|
---|
| 32 |
|
---|
| 33 | /**
|
---|
| 34 | * @see Zend_Gdata_Exif_Extension_Tags
|
---|
| 35 | */
|
---|
| 36 | require_once 'Zend/Gdata/Exif/Extension/Tags.php';
|
---|
| 37 |
|
---|
| 38 | /**
|
---|
| 39 | * An Atom entry containing EXIF metadata.
|
---|
| 40 | *
|
---|
| 41 | * @category Zend
|
---|
| 42 | * @package Zend_Gdata
|
---|
| 43 | * @subpackage Exif
|
---|
| 44 | * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
---|
| 45 | * @license http://framework.zend.com/license/new-bsd New BSD License
|
---|
| 46 | */
|
---|
| 47 | class Zend_Gdata_Exif_Entry extends Zend_Gdata_Entry
|
---|
| 48 | {
|
---|
| 49 | /**
|
---|
| 50 | * The classname for individual feed elements.
|
---|
| 51 | *
|
---|
| 52 | * @var string
|
---|
| 53 | */
|
---|
| 54 | protected $_entryClassName = 'Zend_Gdata_Exif_Entry';
|
---|
| 55 |
|
---|
| 56 | /**
|
---|
| 57 | * The tags that belong to the Exif group.
|
---|
| 58 | *
|
---|
| 59 | * @var string
|
---|
| 60 | */
|
---|
| 61 | protected $_tags = null;
|
---|
| 62 |
|
---|
| 63 | /**
|
---|
| 64 | * Create a new instance.
|
---|
| 65 | *
|
---|
| 66 | * @param DOMElement $element (optional) DOMElement from which this
|
---|
| 67 | * object should be constructed.
|
---|
| 68 | */
|
---|
| 69 | public function __construct($element = null)
|
---|
| 70 | {
|
---|
| 71 | $this->registerAllNamespaces(Zend_Gdata_Exif::$namespaces);
|
---|
| 72 | parent::__construct($element);
|
---|
| 73 | }
|
---|
| 74 |
|
---|
| 75 | /**
|
---|
| 76 | * Retrieves a DOMElement which corresponds to this element and all
|
---|
| 77 | * child properties. This is used to build an entry back into a DOM
|
---|
| 78 | * and eventually XML text for sending to the server upon updates, or
|
---|
| 79 | * for application storage/persistence.
|
---|
| 80 | *
|
---|
| 81 | * @param DOMDocument $doc The DOMDocument used to construct DOMElements
|
---|
| 82 | * @return DOMElement The DOMElement representing this element and all
|
---|
| 83 | * child properties.
|
---|
| 84 | */
|
---|
| 85 | public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
|
---|
| 86 | {
|
---|
| 87 | $element = parent::getDOM($doc, $majorVersion, $minorVersion);
|
---|
| 88 | if ($this->_tags != null) {
|
---|
| 89 | $element->appendChild($this->_tags->getDOM($element->ownerDocument));
|
---|
| 90 | }
|
---|
| 91 | return $element;
|
---|
| 92 | }
|
---|
| 93 |
|
---|
| 94 | /**
|
---|
| 95 | * Creates individual Entry objects of the appropriate type and
|
---|
| 96 | * stores them as members of this entry based upon DOM data.
|
---|
| 97 | *
|
---|
| 98 | * @param DOMNode $child The DOMNode to process
|
---|
| 99 | */
|
---|
| 100 | protected function takeChildFromDOM($child)
|
---|
| 101 | {
|
---|
| 102 | $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
|
---|
| 103 | switch ($absoluteNodeName) {
|
---|
| 104 | case $this->lookupNamespace('exif') . ':' . 'tags':
|
---|
| 105 | $tags = new Zend_Gdata_Exif_Extension_Tags();
|
---|
| 106 | $tags->transferFromDOM($child);
|
---|
| 107 | $this->_tags = $tags;
|
---|
| 108 | break;
|
---|
| 109 | default:
|
---|
| 110 | parent::takeChildFromDOM($child);
|
---|
| 111 | break;
|
---|
| 112 | }
|
---|
| 113 | }
|
---|
| 114 |
|
---|
| 115 | /**
|
---|
| 116 | * Retrieve the tags for this entry.
|
---|
| 117 | *
|
---|
| 118 | * @see setTags
|
---|
| 119 | * @return Zend_Gdata_Exif_Extension_Tags The requested object
|
---|
| 120 | * or null if not set.
|
---|
| 121 | */
|
---|
| 122 | public function getTags()
|
---|
| 123 | {
|
---|
| 124 | return $this->_tags;
|
---|
| 125 | }
|
---|
| 126 |
|
---|
| 127 | /**
|
---|
| 128 | * Set the tags property for this entry. This property contains
|
---|
| 129 | * various Exif data.
|
---|
| 130 | *
|
---|
| 131 | * This corresponds to the <exif:tags> property in the Google Data
|
---|
| 132 | * protocol.
|
---|
| 133 | *
|
---|
| 134 | * @param Zend_Gdata_Exif_Extension_Tags $value The desired value
|
---|
| 135 | * this element, or null to unset.
|
---|
| 136 | * @return Zend_Gdata_Exif_Entry Provides a fluent interface
|
---|
| 137 | */
|
---|
| 138 | public function setTags($value)
|
---|
| 139 | {
|
---|
| 140 | $this->_tags = $value;
|
---|
| 141 | return $this;
|
---|
| 142 | }
|
---|
| 143 |
|
---|
| 144 | }
|
---|