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


class DBWorkHLZahlarten extends DBWorkHLBasis
{
  
  public function getNewObject()
  {
    return new Zahlart();
  }

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

  
  public function getCurrentRow($pRefreshCache = false)
  {
    $tmp = $this->getNewObject();

    $tmp->nr = $this->getDatamodulValue('nr');
    $tmp->typ = $this->getDatamodulValue('typ');
    $tmp->text = $this->getDatamodulValue('text');

    return $tmp;
  }

  
  public function getAll()
  {
    $this->dboperation->clear();
    $this->dboperation->query('SELECT nr, typ, text FROM zahlartbel');

    return $this->getAllRows();
  }

  
  public function getOne($pNr)
  {
    $nr = $this->dboperation->getString4Sql($pNr);
    $this->dboperation->clear();
    $this->dboperation->query("SELECT nr, typ, text FROM zahlartbel WHERE nr = '" . $nr . "'");

    return $this->getFirstRow();
  }
}