public function field($field, $value = null)
 {
     if (DevValue::isNotNull($value)) {
         $this->_data[$field] = $value;
     } else {
         $value = isset($this->_data[$field]) ? $this->_data[$field] : null;
     }
     return $value;
 }
示例#2
0
 public function __construct($value = null)
 {
     $value = $value ? true : false;
     parent::__construct($value);
 }
 public function _isValid($allow_zero = true)
 {
     $number = $this->_value;
     return is_numeric($number) && (DevValue::isNotNull($number) && $number != 0 || $allow_zero);
 }