19declare(strict_types=1);
38 $this->
id = (
int) $data[
'unit_id'];
39 $this->unit =
$data[
'unit'];
40 $this->factor = (float)
$data[
'factor'];
41 $this->baseunit = (
int)
$data[
'baseunit_fi'];
42 $this->baseunit_title =
$data[
'baseunit_title'] ??
null;
43 $this->category = (
int)
$data[
'category_fi'];
44 $this->sequence = (
int)
$data[
'sequence'];
57 public function setUnit(
string $unit): void
69 return htmlspecialchars($this->
getUnit(), ENT_QUOTES | ENT_SUBSTITUTE,
'utf-8');
99 if ($this->baseunit > 0) {
136 $txt =
$DIC->language()->txt(
"qpl_qst_formulaquestion_{$unit}");
137 return strcmp(
"-qpl_qst_formulaquestion_{$unit}-", $txt) !== 0
148 'SELECT factor FROM il_qpl_qst_fq_unit WHERE unit_id = %s',
155 return (
float) $row[
'factor'];
160 return htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE,
'utf-8');