source: extensions/Google2Piwigo/include/Zend/Gdata/Books/VolumeQuery.php @ 17475

Revision 17475, 3.0 KB checked in by mistic100, 7 years ago (diff)

new extension: Google2Piwigo

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