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


class DBWorkHLMedien extends DBWork
{
  public function __construct($pDBTyp = 1, $pNewInstance = false)
  {
    parent::__construct($pDBTyp, $pNewInstance);

    $this->select = 'bezeichnung';
  }

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

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

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

    $obj->bezeichnung = $this->getDatamodulValue('bezeichnung');

    return $obj;
  }

  
  public function getAllMedien()
  {
    $sql = "SELECT $this->select FROM medien";
    $this->dboperation->clear();
    $this->dboperation->query($sql);

    return $this->getAllRows();
  }
}