Issue 343 - Problem when condition have var and default attribute both.

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9482 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ucorina 2011-10-04 14:50:26 +00:00
parent 3815aece09
commit 36211cb65b
5 changed files with 120 additions and 28 deletions

View file

@ -29,6 +29,24 @@
function toString(){
$validator = '';
if($this->filter){
$validator .= sprintf("$%s_argument->checkFilter('%s');\n"
, $this->argument_name
, $this->filter
);
}
if($this->min_length){
$validator .= sprintf("$%s_argument->checkMinLength(%s);\n"
, $this->argument_name
, $this->min_length
);
}
if($this->max_length){
$validator .= sprintf("$%s_argument->checkMaxLength(%s);\n"
, $this->argument_name
, $this->max_length
);
}
if(isset($this->default_value)){
$this->default_value = new DefaultValue($this->argument_name, $this->default_value);
if($this->default_value->isSequence())
@ -48,24 +66,6 @@
, $this->argument_name
);
}
if($this->filter){
$validator .= sprintf("$%s_argument->checkFilter('%s');\n"
, $this->argument_name
, $this->filter
);
}
if($this->min_length){
$validator .= sprintf("$%s_argument->checkMinLength(%s);\n"
, $this->argument_name
, $this->min_length
);
}
if($this->max_length){
$validator .= sprintf("$%s_argument->checkMaxLength(%s);\n"
, $this->argument_name
, $this->max_length
);
}
return $validator;
}
}