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 Exif
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_Exif
0031  */
0032 // require_once 'Zend/Gdata/Exif.php';
0033 
0034 /**
0035  * @see Zend_Gdata_Exif_Extension_Tags
0036  */
0037 // require_once 'Zend/Gdata/Exif/Extension/Tags.php';
0038 
0039 /**
0040  * An Atom entry containing EXIF metadata.
0041  *
0042  * @category   Zend
0043  * @package    Zend_Gdata
0044  * @subpackage Exif
0045  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0046  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0047  */
0048 class Zend_Gdata_Exif_Entry extends Zend_Gdata_Entry
0049 {
0050     /**
0051      * The classname for individual feed elements.
0052      *
0053      * @var string
0054      */
0055     protected $_entryClassName = 'Zend_Gdata_Exif_Entry';
0056 
0057     /**
0058      * The tags that belong to the Exif group.
0059      *
0060      * @var string
0061      */
0062     protected $_tags = null;
0063 
0064     /**
0065      * Create a new instance.
0066      *
0067      * @param DOMElement $element (optional) DOMElement from which this
0068      *          object should be constructed.
0069      */
0070     public function __construct($element = null)
0071     {
0072         $this->registerAllNamespaces(Zend_Gdata_Exif::$namespaces);
0073         parent::__construct($element);
0074     }
0075 
0076     /**
0077      * Retrieves a DOMElement which corresponds to this element and all
0078      * child properties.  This is used to build an entry back into a DOM
0079      * and eventually XML text for sending to the server upon updates, or
0080      * for application storage/persistence.
0081      *
0082      * @param DOMDocument $doc The DOMDocument used to construct DOMElements
0083      * @return DOMElement The DOMElement representing this element and all
0084      * child properties.
0085      */
0086     public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
0087     {
0088         $element = parent::getDOM($doc, $majorVersion, $minorVersion);
0089         if ($this->_tags != null) {
0090             $element->appendChild($this->_tags->getDOM($element->ownerDocument));
0091         }
0092         return $element;
0093     }
0094 
0095     /**
0096      * Creates individual Entry objects of the appropriate type and
0097      * stores them as members of this entry based upon DOM data.
0098      *
0099      * @param DOMNode $child The DOMNode to process
0100      */
0101     protected function takeChildFromDOM($child)
0102     {
0103         $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
0104         switch ($absoluteNodeName) {
0105         case $this->lookupNamespace('exif') . ':' . 'tags':
0106             $tags = new Zend_Gdata_Exif_Extension_Tags();
0107             $tags->transferFromDOM($child);
0108             $this->_tags = $tags;
0109             break;
0110         default:
0111             parent::takeChildFromDOM($child);
0112             break;
0113         }
0114     }
0115 
0116     /**
0117      * Retrieve the tags for this entry.
0118      *
0119      * @see setTags
0120      * @return Zend_Gdata_Exif_Extension_Tags The requested object
0121      *              or null if not set.
0122      */
0123     public function getTags()
0124     {
0125         return $this->_tags;
0126     }
0127 
0128     /**
0129      * Set the tags property for this entry. This property contains
0130      * various Exif data.
0131      *
0132      * This corresponds to the <exif:tags> property in the Google Data
0133      * protocol.
0134      *
0135      * @param Zend_Gdata_Exif_Extension_Tags $value The desired value
0136      *              this element, or null to unset.
0137      * @return Zend_Gdata_Exif_Entry Provides a fluent interface
0138      */
0139     public function setTags($value)
0140     {
0141         $this->_tags = $value;
0142         return $this;
0143     }
0144 
0145 }