[ZF-10089] Zend_Log
[zend/radio.git] / library / Zend / Gdata / Books / VolumeQuery.php
blob617bb7b136186e219ba95e37bee0891d5c5cb734
1 <?php
3 /**
4 * Zend Framework
6 * LICENSE
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.
16 * @category Zend
17 * @package Zend_Gdata
18 * @subpackage Books
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
21 * @version $Id$
24 /**
25 * Zend_Gdata_Books
27 require_once('Zend/Gdata/Books.php');
29 /**
30 * Zend_Gdata_Query
32 require_once('Zend/Gdata/Query.php');
34 /**
35 * Assists in constructing queries for Books volumes
37 * @category Zend
38 * @package Zend_Gdata
39 * @subpackage Books
40 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
41 * @license http://framework.zend.com/license/new-bsd New BSD License
43 class Zend_Gdata_Books_VolumeQuery extends Zend_Gdata_Query
46 /**
47 * Create Gdata_Books_VolumeQuery object
49 * @param string|null $url If non-null, pre-initializes the instance to
50 * use a given URL.
52 public function __construct($url = null)
54 parent::__construct($url);
57 /**
58 * Sets the minimum level of viewability of volumes to return in the search results
60 * @param string|null $value The minimum viewability - 'full' or 'partial'
61 * @return Zend_Gdata_Books_VolumeQuery Provides a fluent interface
63 public function setMinViewability($value = null)
65 switch ($value) {
66 case 'full_view':
67 $this->_params['min-viewability'] = 'full';
68 break;
69 case 'partial_view':
70 $this->_params['min-viewability'] = 'partial';
71 break;
72 case null:
73 unset($this->_params['min-viewability']);
74 break;
76 return $this;
79 /**
80 * Minimum viewability of volumes to include in search results
82 * @return string|null min-viewability
84 public function getMinViewability()
86 if (array_key_exists('min-viewability', $this->_params)) {
87 return $this->_params['min-viewability'];
88 } else {
89 return null;
93 /**
94 * Returns the generated full query URL
96 * @return string The URL
98 public function getQueryUrl()
100 if (isset($this->_url)) {
101 $url = $this->_url;
102 } else {
103 $url = Zend_Gdata_Books::VOLUME_FEED_URI;
105 if ($this->getCategory() !== null) {
106 $url .= '/-/' . $this->getCategory();
108 $url = $url . $this->getQueryString();
109 return $url;