ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.arStatementCollection.php
Go to the documentation of this file.
1 <?php
2 require_once('class.arStatement.php');
3 
10 abstract class arStatementCollection {
11 
15  protected static $cache = array();
19  protected $statements = array();
23  protected $ar;
24 
25 
29  public function add(arStatement $statement) {
30  $this->statements[] = $statement;
31  }
32 
33 
37  public function hasStatements() {
38  return count($this->statements) > 0;
39  }
40 
41 
47  public static function getInstance(ActiveRecord $ar) {
52  $classname = get_called_class();
53  $arWhereCollection = new $classname();
54  $arWhereCollection->setAr($ar);
55 
56  return $arWhereCollection;
57  }
58 
59 
63  abstract public function asSQLStatement();
64 
65 
69  public function setAr($ar) {
70  $this->ar = $ar;
71  }
72 
73 
77  public function getAr() {
78  return $this->ar;
79  }
80 
81 
85  public function setStatements($statements) {
86  $this->statements = $statements;
87  }
88 
89 
93  public function getStatements() {
94  return $this->statements;
95  }
96 }
97 
98 ?>