ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.arHaving.php
Go to the documentation of this file.
1<?php
2
24class arHaving extends arStatement
25{
26 protected string $table_name = '';
27 protected string $fieldname = '';
31 protected $value;
32 protected string $operator = '=';
33 protected string $statement = '';
34 protected string $glue = 'AND';
35
41 public function asSQLStatement(ActiveRecord $activeRecord, ilDBInterface $db): string
42 {
43 $statement = '';
44 if ($this->getTableName() !== '' && $this->getTableName() !== '0') {
45 $statement .= $this->getTableName() . '.';
46 }
47 $statement .= $db->quoteIdentifier($this->getFieldname()) . ' ' . $this->getOperator() . ' ' . $db->quote($this->getValue()) . '';
48 $this->setStatement($statement);
49
50 return $this->getStatement();
51 }
52
53 public function getFieldname(): string
54 {
55 return $this->fieldname;
56 }
57
58 public function setFieldname(string $fieldname): void
59 {
60 $this->fieldname = $fieldname;
61 }
62
66 public function getValue()
67 {
68 return $this->value;
69 }
70
71 public function setValue(mixed $value): void
72 {
73 $this->value = $value;
74 }
75
76 public function getOperator(): string
77 {
78 return $this->operator;
79 }
80
81 public function setOperator(string $operator): void
82 {
83 $this->operator = $operator;
84 }
85
86 public function getStatement(): string
87 {
88 return $this->statement;
89 }
90
91 public function setStatement(string $statement): void
92 {
93 $this->statement = $statement;
94 }
95
96 public function getGlue(): string
97 {
98 return $this->glue;
99 }
100
101 public function setGlue(string $glue): void
102 {
103 $this->glue = $glue;
104 }
105
106 public function getTableName(): string
107 {
108 return $this->table_name;
109 }
110
111 public function setTableName(string $table_name): void
112 {
113 $this->table_name = $table_name;
114 }
115}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
string $operator
setTableName(string $table_name)
setValue(mixed $value)
string $statement
string $table_name
setGlue(string $glue)
setStatement(string $statement)
setOperator(string $operator)
asSQLStatement(ActiveRecord $activeRecord, ilDBInterface $db)
string $fieldname
string $glue
setFieldname(string $fieldname)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface ilDBInterface.
quoteIdentifier(string $identifier, bool $check_option=false)
quote($value, string $type)