ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
All Data Structures Namespaces Files Functions Variables Typedefs Modules 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 {
12 
16  protected static $cache = array();
20  protected $statements = array();
24  protected $ar;
25 
26 
30  public function add(arStatement $statement)
31  {
32  $this->statements[] = $statement;
33  }
34 
35 
39  public function hasStatements()
40  {
41  return count($this->statements) > 0;
42  }
43 
44 
50  public static function getInstance(ActiveRecord $ar)
51  {
56  $classname = get_called_class();
57  $arWhereCollection = new $classname();
58  $arWhereCollection->setAr($ar);
59 
60  return $arWhereCollection;
61  }
62 
63 
67  abstract public function asSQLStatement();
68 
69 
70 
74  public function setAr($ar)
75  {
76  $this->ar = $ar;
77  }
78 
79 
83  public function getAr()
84  {
85  return $this->ar;
86  }
87 
88 
92  public function setStatements($statements)
93  {
94  $this->statements = $statements;
95  }
96 
97 
101  public function getStatements()
102  {
103  return $this->statements;
104  }
105 }
Class arStatementCollection.
Class ActiveRecord.
Class arStatement.