コード例 #1
0
ファイル: NotEmpty.php プロジェクト: grrr-amsterdam/garp3
 /**
  * Validate the emptiness of a number
  */
 protected function _validateNumber($value, $column)
 {
     // Not much to check, since 0 is falsy but also a valid integer value.
     if (is_null($value)) {
         throw new Garp_Model_Validator_Exception(sprintf(__('%s is a required field'), __(Garp_Util_String::underscoredToReadable($column))));
     }
 }
コード例 #2
0
ファイル: StringTest.php プロジェクト: grrr-amsterdam/garp3
 public function testUnderscoredToReadable()
 {
     $this->assertEquals('This is underscored', Garp_Util_String::underscoredToReadable('this_is_underscored'));
     $this->assertEquals('this is underscored', Garp_Util_String::underscoredToReadable('this_is_underscored', false));
 }