web/lib/Zend/Gdata/Health/Query.php
changeset 886 1e110b03ae96
parent 807 877f952ae2bd
child 1230 68c69c656a2c
--- a/web/lib/Zend/Gdata/Health/Query.php	Sun Apr 21 10:07:03 2013 +0200
+++ b/web/lib/Zend/Gdata/Health/Query.php	Sun Apr 21 21:54:24 2013 +0200
@@ -16,12 +16,17 @@
  * @category   Zend
  * @package    Zend_Gdata
  * @subpackage Health
- * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id: Query.php 20096 2010-01-06 02:05:09Z bkarwin $
+ * @version    $Id: Query.php 24779 2012-05-08 19:13:59Z adamlundrigan $
  */
 
 /**
+ * @see Zend_Exception
+ */
+require_once 'Zend/Exception.php';
+
+/**
  * @see Zend_Gdata_Query
  */
 require_once('Zend/Gdata/Query.php');
@@ -34,7 +39,7 @@
  * @category   Zend
  * @package    Zend_Gdata
  * @subpackage Health
- * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  */
 class Zend_Gdata_Health_Query extends Zend_Gdata_Query
@@ -55,231 +60,16 @@
      * Namespace for an item category
      */
     const ITEM_CATEGORY_NS = 'http://schemas.google.com/health/item';
-
-    /**
-     * The default URI for POST methods
-     *
-     * @var string
-     */
-    protected $_defaultFeedUri = self::HEALTH_PROFILE_FEED_URI;
-
-    /**
-     * Sets the digest parameter's value.
-     *
-     * @param string $value
-     * @return Zend_Gdata_Health_Query Provides a fluent interface
-     */
-    public function setDigest($value)
-    {
-        if ($value !== null) {
-            $this->_params['digest'] = $value;
-        }
-        return $this;
-    }
-
-    /**
-     * Returns the digest parameter's value.
-     *
-     * @return string The value set for the digest parameter.
-     */
-    public function getDigest()
-    {
-        if (array_key_exists('digest', $this->_params)) {
-            return $this->_params['digest'];
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     * Setter for category queries.
-     *
-     * @param string $item A category to query.
-     * @param string $name (optional) A specific item to search a category for.
-     *     An example would be 'Lipitor' if $item is set to 'medication'.
-     * @return Zend_Gdata_Health_Query Provides a fluent interface
-     */
-    public function setCategory($item, $name = null)
-    {
-        $this->_category = $item .
-            ($name ? '/' . urlencode('{' . self::ITEM_CATEGORY_NS . '}' . $name) : null);
-        return $this;
-    }
-
-    /**
-     * Returns the query object's category.
-     *
-     * @return string id
-     */
-    public function getCategory()
-    {
-        return $this->_category;
-    }
-
-    /**
-     * Setter for the grouped parameter.
-     *
-     * @param string $value setting a count of results per group.
-     * @return Zend_Gdata_Health_Query Provides a fluent interface
-     */
-    public function setGrouped($value)
-    {
-        if ($value !== null) {
-            $this->_params['grouped'] = $value;
-        }
-        return $this;
-    }
-
-    /**
-     * Returns the value set for the grouped parameter.
-     *
-     * @return string grouped parameter.
-     */
-    public function getGrouped()
-    {
-        if (array_key_exists('grouped', $this->_params)) {
-            return $this->_params['grouped'];
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     * Setter for the max-results-group parameter.
-     *
-     * @param int $value Specifies the maximum number of groups to be
-     *     retrieved. Must be an integer value greater than zero. This parameter
-     *     is only valid if grouped=true.
-     * @return Zend_Gdata_Health_Query Provides a fluent interface
-     */
-    public function setMaxResultsGroup($value)
-    {
-        if ($value !== null) {
-            if ($value <= 0 || $this->getGrouped() !== 'true') {
-                require_once 'Zend/Gdata/App/InvalidArgumentException.php';
-                throw new Zend_Gdata_App_InvalidArgumentException(
-                    'The max-results-group parameter must be set to a value
-                    greater than 0 and can only be used if grouped=true');
-            } else {
-              $this->_params['max-results-group'] = $value;
-            }
-        }
-        return $this;
-    }
-
+    
     /**
-     *  Returns the value set for max-results-group.
-     *
-     * @return int Returns max-results-group parameter.
+     * Create Gdata_Query object
      */
-    public function getMaxResultsGroup()
-    {
-        if (array_key_exists('max-results-group', $this->_params)) {
-            return $this->_params['max-results-group'];
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     *  Setter for the max-results-group parameter.
-     *
-     * @param int $value Specifies the maximum number of records to be
-     *     retrieved from each group.  The limits that you specify with this
-     *     parameter apply to all groups. Must be an integer value greater than
-     *     zero. This parameter is only valid if grouped=true.
-     * @return Zend_Gdata_Health_Query Provides a fluent interface
-     */
-    public function setMaxResultsInGroup($value)
-    {
-        if ($value !== null) {
-            if ($value <= 0 || $this->getGrouped() !== 'true') {
-              throw new Zend_Gdata_App_InvalidArgumentException(
-                  'The max-results-in-group parameter must be set to a value
-                  greater than 0 and can only be used if grouped=true');
-            } else {
-              $this->_params['max-results-in-group'] = $value;
-            }
-        }
-        return $this;
-    }
-
-    /**
-     *  Returns the value set for max-results-in-group.
-     *
-     * @return int Returns max-results-in-group parameter.
-     */
-    public function getMaxResultsInGroup()
+    public function __construct($url = null)
     {
-        if (array_key_exists('max-results-in-group', $this->_params)) {
-            return $this->_params['max-results-in-group'];
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     * Setter for the start-index-group parameter.
-     *
-     * @param int $value Retrieves only items whose group ranking is at
-     *     least start-index-group. This should be set to a 1-based index of the
-     *     first group to be retrieved. The range is applied per category.
-     *     This parameter is only valid if grouped=true.
-     * @return Zend_Gdata_Health_Query Provides a fluent interface
-     */
-    public function setStartIndexGroup($value)
-    {
-        if ($value !== null && $this->getGrouped() !== 'true') {
-            throw new Zend_Gdata_App_InvalidArgumentException(
-                'The start-index-group can only be used if grouped=true');
-        } else {
-          $this->_params['start-index-group'] = $value;
-        }
-        return $this;
-    }
-
-    /**
-     *  Returns the value set for start-index-group.
-     *
-     * @return int Returns start-index-group parameter.
-     */
-    public function getStartIndexGroup()
-    {
-        if (array_key_exists('start-index-group', $this->_params)) {
-            return $this->_params['start-index-group'];
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     *  Setter for the start-index-in-group parameter.
-     *
-     * @param int $value  A 1-based index of the records to be retrieved from
-     *     each group. This parameter is only valid if grouped=true.
-     * @return Zend_Gdata_Health_Query Provides a fluent interface
-     */
-    public function setStartIndexInGroup($value)
-    {
-        if ($value !== null && $this->getGrouped() !== 'true') {
-            throw new Zend_Gdata_App_InvalidArgumentException('start-index-in-group');
-        } else {
-          $this->_params['start-index-in-group'] = $value;
-        }
-        return $this;
-    }
-
-    /**
-     * Returns the value set for start-index-in-group.
-     *
-     * @return int Returns start-index-in-group parameter.
-     */
-    public function getStartIndexInGroup()
-    {
-        if (array_key_exists('start-index-in-group', $this->_params)) {
-            return $this->_params['start-index-in-group'];
-        } else {
-            return null;
-        }
+        throw new Zend_Exception(
+            'Google Health API has been discontinued by Google and was removed'
+            . ' from Zend Framework in 1.12.0.  For more information see: '
+            . 'http://googleblog.blogspot.ca/2011/06/update-on-google-health-and-google.html'
+        );
     }
 }