/** * Assemble validation rules * * @return array */ protected function assembleValidationRules() { $rules = parent::assembleValidationRules(); $rules[] = 'min[0]'; $rules[] = 'max[65535]'; return $rules; }
/** * Assemble classes * * @param array $classes Classes * * @return array */ protected function assembleClasses(array $classes) { $list = array_diff(parent::assembleClasses($classes), array('integer')); $list[] = 'with-infinity'; $list[] = 'integer-with-infinity'; return $list; }
/** * Sanitize value * * @return mixed */ protected function sanitize() { return '' !== $this->getValue() ? parent::sanitize() : ''; }
/** * Define widget params * * @return void */ protected function defineWidgetParams() { parent::defineWidgetParams(); $this->widgetParams[self::PARAM_MIN]->setValue(1970); $this->widgetParams[self::PARAM_MAX]->setValue(date('Y') + 1); }
/** * Assemble classes * * @param array $classes Classes * * @return array */ protected function assembleClasses(array $classes) { $classes = parent::assembleClasses($classes); $classes[] = 'cvc-number-field'; return $classes; }
/** * Assemble classes * * @param array $classes Classes * * @return array */ protected function assembleClasses(array $classes) { $list = parent::assembleClasses($classes); $list[] = 'no-wheel-mark'; return $list; }