ILIAS  release_8 Revision v8.24
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 $statement): void
37 {
38 $this->statements[] = $statement;
39 }
40
41 public function hasStatements(): bool
42 {
43 return $this->statements !== [];
44 }
45
46 public static function getInstance(ActiveRecord $ar): arStatementCollection
47 {
51 $classname = static::class;
52 $arWhereCollection = new $classname();
53 $arWhereCollection->setAr($ar);
54
55 return $arWhereCollection;
56 }
57
58 abstract public function asSQLStatement(ilDBInterface $db): string;
59
60 public function setAr(ActiveRecord $ar): void
61 {
62 $this->ar = $ar;
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}
Class ActiveRecord.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
asSQLStatement(ilDBInterface $db)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface ilDBInterface.