source: trunk/www.guidonia.net/wp/wp-content/plugins/webtv/Drivers/Zend/Gdata/Books/VolumeQuery.php@ 44

Last change on this file since 44 was 44, checked in by luciano, 14 years ago
File size: 2.9 KB
Line 
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 Books
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 * Zend_Gdata_Books
25 */
26require_once('Zend/Gdata/Books.php');
27
28/**
29 * Zend_Gdata_Query
30 */
31require_once('Zend/Gdata/Query.php');
32
33/**
34 * Assists in constructing queries for Books volumes
35 *
36 * @category Zend
37 * @package Zend_Gdata
38 * @subpackage Books
39 * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
40 * @license http://framework.zend.com/license/new-bsd New BSD License
41 */
42class Zend_Gdata_Books_VolumeQuery extends Zend_Gdata_Query
43{
44
45 /**
46 * Create Gdata_Books_VolumeQuery object
47 *
48 * @param string|null $url If non-null, pre-initializes the instance to
49 * use a given URL.
50 */
51 public function __construct($url = null)
52 {
53 parent::__construct($url);
54 }
55
56 /**
57 * Sets the minimum level of viewability of volumes to return in the search results
58 *
59 * @param string|null $value The minimum viewability - 'full' or 'partial'
60 * @return Zend_Gdata_Books_VolumeQuery Provides a fluent interface
61 */
62 public function setMinViewability($value = null)
63 {
64 switch ($value) {
65 case 'full_view':
66 $this->_params['min-viewability'] = 'full';
67 break;
68 case 'partial_view':
69 $this->_params['min-viewability'] = 'partial';
70 break;
71 case null:
72 unset($this->_params['min-viewability']);
73 break;
74 }
75 return $this;
76 }
77
78 /**
79 * Minimum viewability of volumes to include in search results
80 *
81 * @return string|null min-viewability
82 */
83 public function getMinViewability()
84 {
85 if (array_key_exists('min-viewability', $this->_params)) {
86 return $this->_params['min-viewability'];
87 } else {
88 return null;
89 }
90 }
91
92 /**
93 * Returns the generated full query URL
94 *
95 * @return string The URL
96 */
97 public function getQueryUrl()
98 {
99 if (isset($this->_url)) {
100 $url = $this->_url;
101 } else {
102 $url = Zend_Gdata_Books::VOLUME_FEED_URI;
103 }
104 if ($this->getCategory() !== null) {
105 $url .= '/-/' . $this->getCategory();
106 }
107 $url = $url . $this->getQueryString();
108 return $url;
109 }
110
111}
Note: See TracBrowser for help on using the repository browser.