ILIAS  release_8 Revision v8.24
class.arSelect.php
Go to the documentation of this file.
1<?php
2
24class arSelect extends arStatement
25{
26 protected string $table_name = '';
27 protected string $as = '';
28 protected string $field_name = '';
29
30 public function asSQLStatement(ActiveRecord $activeRecord, ilDBInterface $db): string
31 {
32 $return = '';
33 if ($this->getTableName() !== '' && $this->getTableName() !== '0') {
34 $return .= $this->getTableName() . '.';
35 }
36 $return .= $this->wrapField($this->getFieldName(), $db);
37 if ($this->getAs() && $this->getFieldName() !== '*') {
38 $return .= ' AS ' . $this->getAs();
39 }
40
41 return $return;
42 }
43
44 public function getTableName(): string
45 {
46 return $this->table_name;
47 }
48
49 public function setTableName(string $table_name): void
50 {
51 $this->table_name = $table_name;
52 }
53
54 public function getAs(): string
55 {
56 return $this->as;
57 }
58
59 public function setAs(string $as): void
60 {
61 $this->as = $as;
62 }
63
64 public function getFieldName(): string
65 {
66 return $this->field_name;
67 }
68
69 public function setFieldName(string $field_name): void
70 {
71 $this->field_name = $field_name;
72 }
73}
Class ActiveRecord.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
asSQLStatement(ActiveRecord $activeRecord, ilDBInterface $db)
setFieldName(string $field_name)
setAs(string $as)
string $as
string $field_name
setTableName(string $table_name)
string $table_name
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
wrapField(string $field, ilDBInterface $db)
Interface ilDBInterface.