Beispiel #1
0
 /**
  * Returns value if every character is alphabetic or a digit,
  * FALSE otherwise.
  *
  * @param mixed $key
  * @return mixed
  *
  * @tag validator
  */
 function testAlnum($key)
 {
     if (!$this->keyExists($key)) {
         return false;
     }
     if (Inspekt::isAlnum($this->_getValue($key))) {
         return $this->_getValue($key);
     }
     return FALSE;
 }
 /** 
  * Descricao : Verifica se o dado do formulario for alfa numerico
  * 
  * @param Field field : Um objeto field
  * 
  * @return True se o dado for alfa numerico
  */
 private function alnumValidation($field)
 {
     if ($field->getMethod() == "get") {
         return Inspekt::isAlnum($_GET[$field->getName()]);
     } else {
         return Inspekt::isAlnum($_POST[$field->getName()]);
     }
 }
Beispiel #3
0
 /**
  * Generated from @assert ('_funkatronuser') === false.
  */
 public function testIsAlnum6()
 {
     $this->assertSame(false, Inspekt::isAlnum('_funkatronuser'));
 }
Beispiel #4
0
 /**
  * Returns value if every character is alphabetic or a digit,
  * FALSE otherwise.
  *
  * @param mixed $key
  * @return mixed
  * @throws Exception
  * @tag validator
  */
 public function testAlnum($key)
 {
     $value = $this->getValueOrNull($key);
     if (!is_null($value) && Inspekt::isAlnum($value)) {
         return $value;
     }
     return false;
 }