Example #1
0
 public function set($value)
 {
     if (!is_numeric($value)) {
         throw new ModelException("Field {$this->_model}.{$this->name}: Not a numeric value : {$value}");
     }
     return parent::set($value);
 }
Example #2
0
 public function __construct($dict = array())
 {
     $this->maxlength = Functions::nz($dict['maxlength'], 255);
     if (!isset($dict['default'])) {
         $dict['default'] = '';
     }
     parent::__construct($dict);
 }
Example #3
0
 public function set($value)
 {
     if ($value === '') {
         $value = 0;
     }
     if (!is_numeric($value)) {
         throw new ModelException("Field {$this->_model}.{$this->name}: Not a numeric value : {$value}");
     }
     if ($value < 0) {
         throw new ModelException("Field {$this->name}: no negative values allowed : {$value}");
     }
     return parent::set($value);
 }
Example #4
0
 public function __construct($dict = array())
 {
     $this->size = Functions::nz($dict['size'], 5);
     parent::__construct($dict);
 }
Example #5
0
 public function __construct($dict = array())
 {
     $this->options = Functions::nz($dict['options'], array());
     parent::__construct($dict);
 }