| @@ 108-128 (lines=21) @@ | ||
| 105 | return true; |
|
| 106 | } |
|
| 107 | ||
| 108 | function validate($input) |
|
| 109 | { |
|
| 110 | $validator = new Intraface_Validator($this->error); |
|
| 111 | ||
| 112 | $validator->isNumeric($input['running_index'], 'Index is not a valid number'); |
|
| 113 | $validator->isNumeric($input['evaluate_target_key'], 'Evaluation target is not valid'); |
|
| 114 | $validator->isNumeric($input['evaluate_method_key'], 'Evaluation method is not valid'); |
|
| 115 | $validator->isString($input['evaluate_value'], 'Evaluation value is not valid', '', 'allow_empty'); |
|
| 116 | $validator->isNumeric($input['go_to_index_after'], 'Go to index after is not a valid number'); |
|
| 117 | $validator->isNumeric($input['action_action_key'], 'Action is not valid'); |
|
| 118 | $validator->isString($input['action_value'], 'Target is not valid', '', 'allow_empty'); |
|
| 119 | $validator->isNumeric($input['action_quantity'], 'Action quantity is not a valid number', 'zero_or_greater'); |
|
| 120 | $validator->isNumeric($input['action_unit_key'], 'Action unit is not valid'); |
|
| 121 | ||
| 122 | if ($this->error->isError()) { |
|
| 123 | return false; |
|
| 124 | } |
|
| 125 | ||
| 126 | return true; |
|
| 127 | } |
|
| 128 | ||
| 129 | /** |
|
| 130 | * Saves and validates the evaluation |
|
| 131 | * |
|
| @@ 114-134 (lines=21) @@ | ||
| 111 | return true; |
|
| 112 | } |
|
| 113 | ||
| 114 | function validate($input) |
|
| 115 | { |
|
| 116 | $validator = new Intraface_Validator($this->error); |
|
| 117 | ||
| 118 | $validator->isNumeric($input['running_index'], 'Index is not a valid number'); |
|
| 119 | $validator->isNumeric($input['evaluate_target_key'], 'Evaluation target is not valid'); |
|
| 120 | $validator->isNumeric($input['evaluate_method_key'], 'Evaluation method is not valid'); |
|
| 121 | $validator->isString($input['evaluate_value'], 'Evaluation value is not valid', '', 'allow_empty'); |
|
| 122 | $validator->isNumeric($input['go_to_index_after'], 'Go to index after is not a valid number'); |
|
| 123 | $validator->isNumeric($input['action_action_key'], 'Action is not valid'); |
|
| 124 | $validator->isString($input['action_value'], 'Target is not valid', '', 'allow_empty'); |
|
| 125 | $validator->isNumeric($input['action_quantity'], 'Action quantity is not a valid number', 'zero_or_greater'); |
|
| 126 | $validator->isNumeric($input['action_unit_key'], 'Action unit is not valid'); |
|
| 127 | ||
| 128 | if ($this->error->isError()) { |
|
| 129 | return false; |
|
| 130 | } |
|
| 131 | ||
| 132 | return true; |
|
| 133 | } |
|
| 134 | ||
| 135 | /** |
|
| 136 | * Saves and validates the evaluation |
|
| 137 | * |
|