add validations

This commit is contained in:
Harald Bamberger
2023-05-05 08:20:29 +02:00
parent f84a75af4e
commit 42ff682700
3 changed files with 34 additions and 1 deletions
@@ -86,6 +86,28 @@ EOTXT;
public function validate()
{
if( !(filter_var($this->arbeitgeber_frist, FILTER_VALIDATE_INT,
array(
'options' => array(
'min_range' => 0,
'max_range' => 52
)
)
)) ) {
$this->validationerrors[] = 'Arbeitgeberfrist muss eine Wochenanzahl im Bereich 1 bis 52 sein.';
}
if( !(filter_var($this->arbeitnehmer_frist, FILTER_VALIDATE_INT,
array(
'options' => array(
'min_range' => 1,
'max_range' => 52
)
)
)) ) {
$this->validationerrors[] = 'Arbeitnehmerfrist muss eine Wochenanzahl im Bereich 1 bis 52 sein.';
}
return parent::validate();
}
}
@@ -88,7 +88,7 @@ EOTXT;
)
)
)) ) {
$this->validationerrors[] = 'Stunden muss eine Kommazahl im Bereichs 0 bis 100 sein.';
$this->validationerrors[] = 'Stunden muss eine Kommazahl im Bereich 0 bis 100 sein.';
}
return parent::validate();
@@ -64,6 +64,17 @@ EOTXT;
public function validate()
{
if( !(filter_var($this->tage, FILTER_VALIDATE_INT,
array(
'options' => array(
'min_range' => 1,
'max_range' => 50
)
)
)) ) {
$this->validationerrors[] = 'Arbeitgeberfrist muss eine Tagesanzahl im Bereich 1 bis 50 sein.';
}
return parent::validate();
}
}