63 static $number_of_arguments = 0;
65 $this->argument_name = $tag->attrs->var;
66 if(!$this->argument_name)
68 $this->argument_name = str_replace(
'.',
'_', $tag->attrs->name);
70 if(!$this->argument_name)
72 $this->argument_name = str_replace(
'.',
'_', $tag->attrs->column);
77 $number_of_arguments++;
78 $this->argument_name .= $number_of_arguments;
80 $name = $tag->attrs->name;
83 $name = $tag->attrs->column;
85 if(strpos($name,
'.') === FALSE)
87 $this->column_name = $name;
91 list($prefix, $name) = explode(
'.', $name);
92 $this->column_name = $name;
93 $this->table_name = $prefix;
96 if($tag->attrs->operation)
98 $this->operation = $tag->attrs->operation;
122 return $this->argument_validator->toString();
143 $arg = sprintf(
"\n" .
'${\'%s_argument\'} = new ConditionArgument(\'%s\', %s, \'%s\');' .
"\n"
144 , $this->argument_name
145 , $this->variable_name
146 ,
'$args->' . $this->variable_name
150 $arg .= $this->argument_validator->toString();
153 $arg .= sprintf(
'${\'%s_argument\'}->createConditionValue();' .
"\n"
154 , $this->argument_name
158 $arg .= sprintf(
'if(!${\'%s_argument\'}->isValid()) return ${\'%s_argument\'}->getErrorMessage();' .
"\n"
159 , $this->argument_name
160 , $this->argument_name
165 $arg = sprintf(
"\n" .
'${\'%s_argument\'} = new Argument(\'%s\', %s);' .
"\n"
166 , $this->argument_name
167 , $this->variable_name
168 , $this->ignore_value ?
'NULL' :
'$args->{\'' . $this->variable_name .
'\'}
');
170 $arg .= $this->argument_validator->toString();
172 $arg .= sprintf('if(!${\
'%s_argument\'}->isValid()) return ${\'%s_argument\'}->getErrorMessage();' .
"\n"
179 if($this->argument_validator->isIgnorable())
181 $arg = sprintf(
"if(isset(%s)) {",
'$args->' . $this->variable_name)
183 . sprintf(
"} else\n" .
'${\'%s_argument\'} = NULL;', $this->argument_name);
__construct($tag, $ignore_value=FALSE)