File indexing completed on 2024-12-22 05:36:51

0001 <?php
0002 /**
0003  * Zend Framework
0004  *
0005  * LICENSE
0006  *
0007  * This source file is subject to the new BSD license that is bundled
0008  * with this package in the file LICENSE.txt.
0009  * It is also available through the world-wide-web at this URL:
0010  * http://framework.zend.com/license/new-bsd
0011  * If you did not receive a copy of the license and are unable to
0012  * obtain it through the world-wide-web, please send an email
0013  * to license@zend.com so we can send you a copy immediately.
0014  *
0015  * @category  Zend
0016  * @package   Zend_Measure
0017  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0018  * @license   http://framework.zend.com/license/new-bsd     New BSD License
0019  * @version   $Id$
0020  */
0021 
0022 /**
0023  * Implement needed classes
0024  */
0025 // require_once 'Zend/Measure/Abstract.php';
0026 // require_once 'Zend/Locale.php';
0027 
0028 /**
0029  * Class for handling cooking weight conversions
0030  *
0031  * @category   Zend
0032  * @package    Zend_Measure
0033  * @subpackage Zend_Measure_Cooking_Weight
0034  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0035  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0036  */
0037 class Zend_Measure_Cooking_Weight extends Zend_Measure_Abstract
0038 {
0039     const STANDARD = 'GRAM';
0040 
0041     const HALF_STICK    = 'HALF_STICK';
0042     const STICK         = 'STICK';
0043     const CUP           = 'CUP';
0044     const GRAM          = 'GRAM';
0045     const OUNCE         = 'OUNCE';
0046     const POUND         = 'POUND';
0047     const TEASPOON      = 'TEASPOON';
0048     const TEASPOON_US   = 'TEASPOON_US';
0049     const TABLESPOON    = 'TABLESPOON';
0050     const TABLESPOON_US = 'TABLESPOON_US';
0051 
0052     /**
0053      * Calculations for all cooking weight units
0054      *
0055      * @var array
0056      */
0057     protected $_units = array(
0058         'HALF_STICK'    => array(array('' => '453.59237', '/' => '8'),                    'half stk'),
0059         'STICK'         => array(array('' => '453.59237', '/' => '4'),                    'stk'),
0060         'CUP'           => array(array('' => '453.59237', '/' => '2'),                    'c'),
0061         'GRAM'          => array('1',                                                   'g'),
0062         'OUNCE'         => array(array('' => '453.59237', '/' => '16'),                   'oz'),
0063         'POUND'         => array('453.59237',                                           'lb'),
0064         'TEASPOON'      => array(array('' => '1.2503332', '' => '453.59237', '/' => '128'), 'tsp'),
0065         'TEASPOON_US'   => array(array('' => '453.59237', '/' => '96'),                   'tsp'),
0066         'TABLESPOON'    => array(array('' => '1.2503332', '' => '453.59237', '/' => '32'),  'tbsp'),
0067         'TABLESPOON_US' => array(array('' => '453.59237', '/' => '32'),                   'tbsp'),
0068         'STANDARD'      => 'GRAM'
0069     );
0070 }