<?php
/**
 * @copyright (c) Kufer Software GmbH, Oderstraße 7, D-84453 Mühldorf
 */

namespace Kufer\Web\Classes\Db;

use Kufer\Web\Classes\Identifier\Identifier;

class AnwesenheitFilter
{
  public $knr;
  public $statusAry;
  public $vonDate;
  public $bisDate;
  public $allowKinder5;
  public $ktId;
  public $firmaTnr;
  public $teilnehmerTnr;
  public $fnSetDBWorkBelegungOrder;

  
  public function __construct(
    string $knr,
    ?array $statusAry = array(),
    ?string $vonDat = null,
    ?string $bisDat = null,
    bool $allowKinder5 = false,
    $ktId = null,
    $firmaTnr = null,
    $teilnehmerTnr = null,
    $fnSetDBWorkBelegungOrder = null
  ) {
    $this->knr = $knr;
    $this->statusAry = $statusAry ?? array();
    if (\DateTimeOperations::isEmptyOrDefault($vonDat)) {
      $this->vonDate = null;
    } else {
      $this->vonDate = $vonDat;
    }

    if (\DateTimeOperations::isEmptyOrDefault($bisDat)) {
      $this->bisDate = null;
    } else {
      $this->bisDate = $bisDat;
    }

    $this->allowKinder5 = $allowKinder5;
    $this->ktId = $ktId;
    $this->firmaTnr = $firmaTnr;
    $this->teilnehmerTnr = $teilnehmerTnr;
    $this->fnSetDBWorkBelegungOrder = $fnSetDBWorkBelegungOrder;
  }
}