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

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


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

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

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

  
  public function getOneByKennz($pKennz)
  {
    $kennz = $this->dboperation->getString4Sql($pKennz);
    $sql = 'SELECT ' . $this->select . ' FROM ' . $this->getTableName() . ' WHERE kennz=\'' . $kennz . '\'';
    $this->dboperation->clear();
    $this->dboperation->query($sql);
    $this->dboperation->selectRow(0);

    return $this->getFirstRow();
  }
}