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-2009 Zend Technologies USA Inc.
20 * (http://www.zend.com)
21 * @license http://framework.zend.com/license/new-bsd New BSD License
25 * @see Zend_Gdata_Extension
27 require_once 'Zend/Gdata/Extension.php';
30 * Describes an embeddability
35 * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc.
36 * (http://www.zend.com)
37 * @license http://framework.zend.com/license/new-bsd New BSD License
39 class Zend_Gdata_Books_Extension_Embeddability
extends Zend_Gdata_Extension
42 protected $_rootNamespace = 'gbs';
43 protected $_rootElement = 'embeddability';
44 protected $_value = null;
47 * Constructor for Zend_Gdata_Books_Extension_Embeddability which
48 * Describes an embeddability.
50 * @param string|null $value A programmatic value representing the book's
53 public function __construct($value = null)
55 $this->registerAllNamespaces(Zend_Gdata_Books
::$namespaces);
56 parent
::__construct();
57 $this->_value
= $value;
61 * Retrieves DOMElement which corresponds to this element and all
62 * child properties. This is used to build this object back into a DOM
63 * and eventually XML text for sending to the server upon updates, or
64 * for application storage/persistance.
66 * @param DOMDocument $doc The DOMDocument used to construct DOMElements
67 * @return DOMElement The DOMElement representing this element and all
70 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
72 $element = parent
::getDOM($doc);
73 if ($this->_value
!== null) {
74 $element->setAttribute('value', $this->_value
);
80 * Extracts XML attributes from the DOM and converts them to the
81 * appropriate object members.
83 * @param DOMNode $attribute The DOMNode attribute to be handled.
85 protected function takeAttributeFromDOM($attribute)
87 switch ($attribute->localName
) {
89 $this->_value
= $attribute->nodeValue
;
92 parent
::takeAttributeFromDOM($attribute);
97 * Returns the programmatic value that describes the embeddability of a
98 * volume in Google Book Search
100 * @return string|null The value
102 public function getValue()
104 return $this->_value
;
108 * Sets the programmatic value that describes the embeddability of a
109 * volume in Google Book Search
111 * @param string|null $value Programmatic value that describes the
112 * embeddability of a volume in Google Book Search
113 * @return Zend_Gdata_Books_Extension_Embeddability Provides a fluent
116 public function setValue($value)
118 $this->_value
= $value;