<?php
/**
 * @copyright (c) Kufer Software GmbH, Loisachstrasse 4, D-84453 Mühldorf
 */

if (!defined('BASEDIR')) {
  include_once '..' . DIRECTORY_SEPARATOR . 'constants.php';
}


class DBWorkMwst extends DBWorkGenerated
{
  public function __construct($pDBTyp = 1, $pNewInstance = false)
  {
    parent::__construct($pDBTyp, $pNewInstance);
    $this->select = 'id, schluessel, text, prozente, anteil';
    $this->_dataModulFields = array('text', 'schluessel', 'prozente', 'anteil', 'id');
  }

  
  public function getNewObject()
  {
    return new Mwst();
  }

  public function getTableName(): string
  {
    return 'mwst';
  }

  public function getAllCached()
  {
    static $cache = null;
    if (is_null($cache)) {
      $cache = ArrayOperations::setAttributAsKey($this->getAll(), 'schluessel');
    }

    return $cache;
  }
}