mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
add validations
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user