ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.arConcat.php
Go to the documentation of this file.
1<?php
2
24class arConcat extends arStatement
25{
26 protected string $as = '';
27 protected array $fields = [];
28
29 public function asSQLStatement(ActiveRecord $activeRecord, ilDBInterface $db): string
30 {
31 $fields = $this->wrapFields($this->getFields(), $db);
32
33 return ' CONCAT(' . implode(', ', $fields) . ') AS ' . $this->getAs();
34 }
35
36 public function getAs(): string
37 {
38 return $this->as;
39 }
40
41 public function setAs(string $as): void
42 {
43 $this->as = $as;
44 }
45
49 public function getFields(): array
50 {
51 return $this->fields;
52 }
53
57 public function setFields(array $fields): void
58 {
59 $this->fields = $fields;
60 }
61}
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...
array $fields
string $as
setFields(array $fields)
setAs(string $as)
asSQLStatement(ActiveRecord $activeRecord, ilDBInterface $db)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
wrapFields(array $fields, ilDBInterface $db)
Interface ilDBInterface.