Hello Ilya,
thank you for your fast answer. Did I got you right, that when I want to change other configuration parameters like this
&CCS::Data::Datatype::base_class::config_parameter(
max_length => {max => 255, default => 255},
min_length => {max => 255});
which is taken from my String class, I need to override your sub parameter_config in this way?
sub parameter_config {
return {max_length => {max => 255, default =>255));
}
But I also need the other parameters from base class (like min => 0 and valid => 0 in this case).
Or could I do something like this:
my $parameter_config = SUPER->parameter_config;
$parameter_config->{max_length}{max} = 255;
$parameter_config->{max_length}{default} = 255;
sub parameter_config { $parameter_config }
My classes not only inherit from base_class.pm. There are also datatypes that inherit from other datatypes. Such as Text inherits from String (but no direct base_class) and PrimaryKey inherits from Integer. Is such inheritance with one of this configuration methods combineable?
My goal is, that I can add new parameters only in base_class (let's say has_double_letters or max_number / min_number) and all the datatypes need only to "activate" this new parameters via the ->valid_parameter(qw(mandatory max_number)) call.
Thanks, Uwe
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.