self::getSchema(array('min' => self::_MIN, 'max' => self::_MAX, 'default' => self::_MIN, 'null' => true)), 'max' => self::getSchema(array('min' => self::_MIN, 'max' => self::_MAX, 'default' => self::_MAX, 'null' => true)), 'default' => ElementBoolean::getSchema(array('default' => null, 'null' => true)), 'null' => ElementBoolean::getSchema(array('default' => true, 'null' => true)) )); } public static function getSchema ( $params = array() ) { $params['type'] = 'integer'; return $params; } public static function invalid ( $schema, $value, $data = array() ) { if ( $error = parent::invalid($schema, $value, $data) ) return $error; if ( is_null($value) || is_int($value) ) return false; return 'Value is not an integer !'; } public static function apply ( $schema, $value, $data = array() ) { return $value; if ( !$value ) $value = 0; else $value = (int) $value; return (int) parent::apply($schema, $value, $data); } } ?>