Esempio n. 1
0
 /**
  * Returns value if every character is a digit, FALSE otherwise.
  * This is just like isInt(), except there is no upper limit.
  *
  * @param mixed $key
  * @return mixed
  */
 public function testDigits($key)
 {
     if (!$this->keyExists($key)) {
         return false;
     }
     if (Zend_Filter::isDigits($this->_source[$key])) {
         return $this->_source[$key];
     }
     return FALSE;
 }
Esempio n. 2
0
 /**
  * Returns value if every character is a digit, FALSE otherwise.
  * This is just like isInt(), except there is no upper limit.
  *
  * @param mixed $key
  * @return mixed
  */
 public function isDigits($key)
 {
     return Zend_Filter::isDigits($this->_source[$key]);
 }
Esempio n. 3
0
 /**
  * @deprecated since 0.8.0
  * @return     void
  */
 public function testIsDigits()
 {
     $this->assertTrue(Zend_Filter::isDigits(123456), '123456 is just digits');
     $this->assertTrue(Zend_Filter::isDigits(1), '1 is just digits');
     $this->assertFalse(Zend_Filter::isDigits('12345A'), '"12345A" is not just digits');
 }
Esempio n. 4
0
 /**
  * Returns value if every character is a digit, FALSE otherwise.
  * This is just like isInt(), except there is no upper limit.
  *
  * @param mixed $key
  * @return mixed
  */
 public function testDigits($key = null)
 {
     if (!($value = $this->keyExists($key))) {
         return false;
     }
     if (Zend_Filter::isDigits($value)) {
         return $value;
     }
     return FALSE;
 }