ILIAS  release_8 Revision v8.24
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
74 public function setValue($value): void
75 {
76 $this->value = $value;
77 }
78
79 public function getOperator(): string
80 {
81 return $this->operator;
82 }
83
84 public function setOperator(string $operator): void
85 {
86 $this->operator = $operator;
87 }
88
89 public function getStatement(): string
90 {
91 return $this->statement;
92 }
93
94 public function setStatement(string $statement): void
95 {
96 $this->statement = $statement;
97 }
98
99 public function getGlue(): string
100 {
101 return $this->glue;
102 }
103
104 public function setGlue(string $glue): void
105 {
106 $this->glue = $glue;
107 }
108
109 public function getTableName(): string
110 {
111 return $this->table_name;
112 }
113
114 public function setTableName(string $table_name): void
115 {
116 $this->table_name = $table_name;
117 }
118}
Class ActiveRecord.
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($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)