ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.arStatementCollection.php
Go to the documentation of this file.
1<?php
2
25{
29 protected static array $cache = [];
33 protected array $statements = [];
34 protected ?\ActiveRecord $ar = null;
35
36 public function add(arStatement $arStatement): void
37 {
38 $this->statements[] = $arStatement;
39 }
40
41 public function hasStatements(): bool
42 {
43 return $this->statements !== [];
44 }
45
46 public static function getInstance(ActiveRecord $activeRecord): arStatementCollection
47 {
51 $classname = static::class;
52 $arWhereCollection = new $classname();
53 $arWhereCollection->setAr($activeRecord);
54
55 return $arWhereCollection;
56 }
57
58 abstract public function asSQLStatement(ilDBInterface $db): string;
59
60 public function setAr(ActiveRecord $activeRecord): void
61 {
62 $this->ar = $activeRecord;
63 }
64
65 public function getAr(): ?\ActiveRecord
66 {
67 return $this->ar;
68 }
69
73 public function setStatements(array $statements): void
74 {
75 $this->statements = $statements;
76 }
77
81 public function getStatements(): array
82 {
83 return $this->statements;
84 }
85}
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...
add(arStatement $arStatement)
asSQLStatement(ilDBInterface $db)
setAr(ActiveRecord $activeRecord)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface ilDBInterface.