diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilFactory.php b/application/libraries/vertragsbestandteil/VertragsbestandteilFactory.php index 6e7b0af06..2a7955a45 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilFactory.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilFactory.php @@ -22,6 +22,7 @@ class VertragsbestandteilFactory const VERTRAGSBESTANDTEIL_URLAUBSANSPRUCH = 'urlaubsanspruch'; const VERTRAGSBESTANDTEIL_ZEITAUFZEICHNUNG = 'zeitaufzeichnung'; const VERTRAGSBESTANDTEIL_LEHRE = 'lehre'; + const VERTRAGSBESTANDTEIL_LOHNGUIDE = 'lohnguide'; public static function getVertragsbestandteil($data, $fromdb=false) { @@ -69,6 +70,11 @@ class VertragsbestandteilFactory $vertragsbestandteil = new VertragsbestandteilZeitaufzeichnung(); $vertragsbestandteil->hydrateByStdClass($data, $fromdb); break; + + case self::VERTRAGSBESTANDTEIL_LOHNGUIDE: + $vertragsbestandteil = new VertragsbestandteilLohnguide(); + $vertragsbestandteil->hydrateByStdClass($data, $fromdb); + break; default: throw new Exception('Unknown vertragsbestandteiltyp_kurzbz ' @@ -127,6 +133,12 @@ class VertragsbestandteilFactory $vertragsbestandteildbmodel = $CI->VertragsbestandteilZeitaufzeichnung_model; break; + case self::VERTRAGSBESTANDTEIL_LOHNGUIDE: + $CI->load->model('vertragsbestandteil/VertragsbestandteilLohnguide_model', + 'VertragsbestandteilLohnguide_model'); + $vertragsbestandteildbmodel = $CI->VertragsbestandteilLohnguide_model; + break; + default: throw new Exception('Unknown vertragsbestandteil_kurzbz ' . $vertragsbestandteil_kurzbz); diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilLohnguide.php b/application/libraries/vertragsbestandteil/VertragsbestandteilLohnguide.php new file mode 100644 index 000000000..ef87e35e9 --- /dev/null +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilLohnguide.php @@ -0,0 +1,137 @@ +stellenbezeichnung; + } + + public function setStellenbezeichnung($stellenbezeichnung): self + { + $this->markDirty('stellenbezeichnung', $this->stellenbezeichnung, $stellenbezeichnung); + $this->stellenbezeichnung = $stellenbezeichnung; + return $this; + } + + public function getFachrichtung_kurzbz() + { + return $this->fachrichtung_kurzbz; + } + + public function setFachrichtung_kurzbz($fachrichtung_kurzbz): self + { + $this->markDirty('fachrichtung_kurzbz', $this->fachrichtung_kurzbz, $fachrichtung_kurzbz); + $this->fachrichtung_kurzbz = $fachrichtung_kurzbz; + return $this; + } + + public function getModellstelle_kurzbz() + { + return $this->modellstelle_kurzbz; + } + + public function setModellstelle_kurzbz($modellstelle_kurzbz): self + { + $this->markDirty('modellstelle_kurzbz', $this->modellstelle_kurzbz, $modellstelle_kurzbz); + $this->modellstelle_kurzbz = $modellstelle_kurzbz; + return $this; + } + + public function getKommentar_person() + { + return $this->kommentar_person; + } + + public function setKommentar_person($kommentar_person): self + { + $this->markDirty('kommentar_person', $this->kommentar_person, $kommentar_person); + $this->kommentar_person = $kommentar_person; + return $this; + } + + public function getKommentar_modellstelle() + { + return $this->kommentar_modellstelle; + } + + public function setKommentar_modellstelle($kommentar_modellstelle): self + { + $this->markDirty('kommentar_modellstelle', $this->kommentar_modellstelle, $kommentar_modellstelle); + $this->kommentar_modellstelle = $kommentar_modellstelle; + return $this; + } + + + public function __construct() + { + parent::__construct(); + $this->setVertragsbestandteiltyp_kurzbz( + VertragsbestandteilFactory::VERTRAGSBESTANDTEIL_LOHNGUIDE); + } + + public function hydrateByStdClass($data, $fromdb=false) + { + parent::hydrateByStdClass($data, $fromdb); + $this->fromdb = $fromdb; + isset($data->fachrichtung_kurzbz) && $this->setFachrichtung_kurzbz($data->fachrichtung_kurzbz); + isset($data->stellenbezeichnung) && $this->setStellenbezeichnung($data->stellenbezeichnung); + isset($data->modellstelle_kurzbz) && $this->setModellstelle_kurzbz($data->modellstelle_kurzbz); + isset($data->kommentar_person) && $this->setKommentar_person($data->kommentar_person); + isset($data->kommentar_modellstelle) && $this->setKommentar_modellstelle($data->kommentar_modellstelle); + $this->fromdb = false; + } + + public function toStdClass(): \stdClass + { + $tmp = array( + 'vertragsbestandteil_id' => $this->getVertragsbestandteil_id(), + 'stellenbezeichnung' => $this->getStellenbezeichnung(), + 'fachrichtung' => $this->getFachrichtung_kurzbz(), + 'modellstelle' => $this->getModellstelle_kurzbz(), + 'kommentar_person' => $this->getKommentar_person(), + 'kommentar_modellstelle' => $this->getKommentar_modellstelle(), + ); + + $tmp = array_filter($tmp, function($k) { + return in_array($k, $this->modifiedcolumns); + }, ARRAY_FILTER_USE_KEY); + + return (object) $tmp; + } + + public function __toString() + { + $txt = <<getModellstelle_kurzbz()} + +EOTXT; + return parent::__toString() . $txt; + } + + /* public function validate() + { + if( !(filter_var($this->tage, FILTER_VALIDATE_INT, + array( + 'options' => array( + 'min_range' => 1, + 'max_range' => 50 + ) + ) + )) ) { + $this->validationerrors[] = 'Urlaubsanspruch muss eine Tagesanzahl im Bereich 1 bis 50 sein.'; + } + + return parent::validate(); + } */ +} diff --git a/application/models/vertragsbestandteil/VertragsbestandteilLohnguide_model.php b/application/models/vertragsbestandteil/VertragsbestandteilLohnguide_model.php new file mode 100644 index 000000000..6f3f8e47a --- /dev/null +++ b/application/models/vertragsbestandteil/VertragsbestandteilLohnguide_model.php @@ -0,0 +1,11 @@ +dbTable = 'hr.tbl_vertragsbestandteil_lohnguide'; + $this->pk = 'vertragsbestandteil_id'; + } +}