File indexing completed on 2025-03-02 05:29:19

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_Dojo
0017  * @subpackage Form_Element
0018  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0019  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0020  */
0021 
0022 /** Zend_Dojo_Form_Element_Dijit */
0023 // require_once 'Zend/Dojo/Form/Element/Dijit.php';
0024 
0025 /**
0026  * TextBox dijit
0027  *
0028  * @category   Zend
0029  * @package    Zend_Dojo
0030  * @subpackage Form_Element
0031  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0032  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0033  * @version    $Id$
0034  */
0035 class Zend_Dojo_Form_Element_TextBox extends Zend_Dojo_Form_Element_Dijit
0036 {
0037     /**
0038      * Use TextBox dijit view helper
0039      * @var string
0040      */
0041     public $helper = 'TextBox';
0042 
0043     /**
0044      * Set lowercase flag
0045      *
0046      * @param  bool $lowercase
0047      * @return Zend_Dojo_Form_Element_TextBox
0048      */
0049     public function setLowercase($flag)
0050     {
0051         $this->setDijitParam('lowercase', (bool) $flag);
0052         return $this;
0053     }
0054 
0055     /**
0056      * Retrieve lowercase flag
0057      *
0058      * @return bool
0059      */
0060     public function getLowercase()
0061     {
0062         if (!$this->hasDijitParam('lowercase')) {
0063             return false;
0064         }
0065         return $this->getDijitParam('lowercase');
0066     }
0067 
0068     /**
0069      * Set propercase flag
0070      *
0071      * @param  bool $propercase
0072      * @return Zend_Dojo_Form_Element_TextBox
0073      */
0074     public function setPropercase($flag)
0075     {
0076         $this->setDijitParam('propercase', (bool) $flag);
0077         return $this;
0078     }
0079 
0080     /**
0081      * Retrieve propercase flag
0082      *
0083      * @return bool
0084      */
0085     public function getPropercase()
0086     {
0087         if (!$this->hasDijitParam('propercase')) {
0088             return false;
0089         }
0090         return $this->getDijitParam('propercase');
0091     }
0092 
0093     /**
0094      * Set uppercase flag
0095      *
0096      * @param  bool $uppercase
0097      * @return Zend_Dojo_Form_Element_TextBox
0098      */
0099     public function setUppercase($flag)
0100     {
0101         $this->setDijitParam('uppercase', (bool) $flag);
0102         return $this;
0103     }
0104 
0105     /**
0106      * Retrieve uppercase flag
0107      *
0108      * @return bool
0109      */
0110     public function getUppercase()
0111     {
0112         if (!$this->hasDijitParam('uppercase')) {
0113             return false;
0114         }
0115         return $this->getDijitParam('uppercase');
0116     }
0117 
0118     /**
0119      * Set trim flag
0120      *
0121      * @param  bool $trim
0122      * @return Zend_Dojo_Form_Element_TextBox
0123      */
0124     public function setTrim($flag)
0125     {
0126         $this->setDijitParam('trim', (bool) $flag);
0127         return $this;
0128     }
0129 
0130     /**
0131      * Retrieve trim flag
0132      *
0133      * @return bool
0134      */
0135     public function getTrim()
0136     {
0137         if (!$this->hasDijitParam('trim')) {
0138             return false;
0139         }
0140         return $this->getDijitParam('trim');
0141     }
0142 
0143     /**
0144      * Set maxLength
0145      *
0146      * @param  int $length
0147      * @return Zend_Dojo_Form_Element_TextBox
0148      */
0149     public function setMaxLength($length)
0150     {
0151         $this->setDijitParam('maxLength', (int) $length);
0152         return $this;
0153     }
0154 
0155     /**
0156      * Retrieve maxLength
0157      *
0158      * @return int|null
0159      */
0160     public function getMaxLength()
0161     {
0162         return $this->getDijitParam('maxLength');
0163     }
0164 }