ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ActiveRecordList Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ActiveRecordList:

Public Member Functions

 __construct (ActiveRecord $activeRecord)
 PhpFieldAssignmentTypeMismatchInspection More...
 
 additionalParams (array $additional_params)
 
 where ($where, $operator=null)
 
 orderBy (string $order_by, string $order_direction='ASC')
 
 limit (int $start, int $end)
 
 innerjoinAR (ActiveRecord $activeRecord, $on_this, string $on_external, array $fields=[' *'], string $operator='=', bool $both_external=false)
 
 leftjoin (string $tablename, $on_this, string $on_external, array $fields=[' *'], string $operator='=', bool $both_external=false)
 
 innerjoin (string $tablename, $on_this, string $on_external, array $fields=[' *'], string $operator='=', bool $both_external=false)
 
 concat (array $fields, string $as)
 
 getArWhereCollection ()
 
 getArJoinCollection ()
 
 getArOrderCollection ()
 
 getArLimitCollection ()
 
 getArConcatCollection ()
 
 getArSelectCollection ()
 
 getArHavingCollection ()
 
 setArHavingCollection (\arHavingCollection $arHavingCollection)
 
 dateFormat (string $date_format='d.m.Y - H:i:s')
 
 debug ()
 
 connector (arConnector $arConnector)
 
 raw (bool $set_raw=true)
 
 hasSets ()
 
 affectedRows ()
 
 count ()
 
 getCollection ()
 
 setClass (string $class)
 
 getClass ()
 
 get ()
 
 getFirstFromLastQuery ()
 
 first ()
 
 last ()
 
 getArray (?string $key=null, string|array|null $values=null)
 
 setAR (\ActiveRecord $activeRecord)
 
 getAR ()
 
 getDebug ()
 
 setDateFormat (string $date_format)
 
 getDateFormat ()
 
 setAddidtionalParameters (array $addidtional_parameters)
 
 getAddidtionalParameters ()
 
 setRaw (bool $raw)
 
 getRaw ()
 

Static Public Member Functions

static setLastQuery (string $last_query)
 
static getLastQuery ()
 

Protected Member Functions

 getArConnector ()
 
 join (string $type, string $tablename, $on_this, string $on_external, array $fields=[' *'], string $operator='=', bool $both_external=false)
 
 buildArray (?string $key, $values)
 
 buildRow (?array $row, $values)
 
 loadLastQuery ()
 

Protected Attributes

arWhereCollection $arWhereCollection
 
arJoinCollection $arJoinCollection
 
arOrderCollection $arOrderCollection
 
arLimitCollection $arLimitCollection
 
arConcatCollection $arConcatCollection
 
arSelectCollection $arSelectCollection
 
arHavingCollection $arHavingCollection
 
bool $loaded = false
 
string $class = ''
 
array $result = []
 
array $result_array = []
 
bool $debug = false
 
string $date_format = null
 
array $addidtional_parameters = []
 
arConnector $connector = null
 
ActiveRecord $ar = null
 
bool $raw = false
 

Static Protected Attributes

static string $last_query = null
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning@noinspection NullPointerExceptionInspection NullPointerExceptionInspection NullPointerExceptionInspection NullPointerExceptionInspection Class ActiveRecordList

Author
Oskar Truffer ot@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
Version
2.0.7

Definition at line 29 of file class.ActiveRecordList.php.

Constructor & Destructor Documentation

◆ __construct()

ActiveRecordList::__construct ( ActiveRecord  $activeRecord)

PhpFieldAssignmentTypeMismatchInspection

Definition at line 56 of file class.ActiveRecordList.php.

References getAR(), getArSelectCollection(), ActiveRecord\getConnectorContainerName(), and setAR().

57  {
58  $this->class = $activeRecord::class;
59  $this->setAR($activeRecord);
60  $this->arWhereCollection = arWhereCollection::getInstance($this->getAR());
61  $this->arJoinCollection = arJoinCollection::getInstance($this->getAR());
62  $this->arLimitCollection = arLimitCollection::getInstance($this->getAR());
63  $this->arOrderCollection = arOrderCollection::getInstance($this->getAR());
64  $this->arConcatCollection = arConcatCollection::getInstance($this->getAR());
65  $this->arSelectCollection = arSelectCollection::getInstance($this->getAR());
66  $this->arHavingCollection = arHavingCollection::getInstance($this->getAR());
67 
68  $arSelect = new arSelect();
69  $arSelect->setTableName($activeRecord->getConnectorContainerName());
70  $arSelect->setFieldName('*');
71  $this->getArSelectCollection()->add($arSelect);
72  }
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...
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...
getConnectorContainerName()
Return the Name of your Connector Table
setAR(\ActiveRecord $activeRecord)
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...
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...
+ Here is the call graph for this function:

Member Function Documentation

◆ additionalParams()

ActiveRecordList::additionalParams ( array  $additional_params)

Definition at line 79 of file class.ActiveRecordList.php.

References setAddidtionalParameters().

79  : self
80  {
81  $this->setAddidtionalParameters($additional_params);
82 
83  return $this;
84  }
setAddidtionalParameters(array $addidtional_parameters)
+ Here is the call graph for this function:

◆ affectedRows()

ActiveRecordList::affectedRows ( )

Definition at line 349 of file class.ActiveRecordList.php.

References getArConnector().

Referenced by count(), and hasSets().

349  : int
350  {
351  return $this->getArConnector()->affectedRows($this);
352  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildArray()

ActiveRecordList::buildArray ( ?string  $key,
  $values 
)
protected
Parameters
int | string | array | null$values
Returns
mixed[]|mixed[][]|int[]|string[]|null[]
Exceptions
Exception

Definition at line 431 of file class.ActiveRecordList.php.

References $result_array, buildRow(), and null.

Referenced by getArray().

431  : array
432  {
433  if ($key === null && $values === null) {
434  return $this->result_array;
435  }
436  $array = [];
437  foreach ($this->result_array as $row) {
438  if ($key) {
439  if (!array_key_exists($key, $row)) {
440  throw new Exception("The attribute $key does not exist on this model.");
441  }
442  $array[$row[$key]] = $this->buildRow($row, $values);
443  } else {
444  $array[] = $this->buildRow($row, $values);
445  }
446  }
447 
448  return $array;
449  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
buildRow(?array $row, $values)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildRow()

ActiveRecordList::buildRow ( ?array  $row,
  $values 
)
protected
Parameters
string | array | null$values
Returns
string|int|null|array

Definition at line 455 of file class.ActiveRecordList.php.

References getAddidtionalParameters(), getAR(), getArConnector(), getDateFormat(), getRaw(), and null.

Referenced by buildArray().

456  {
457  if ($values === null) {
458  return $row;
459  }
460 
461  if (!is_array($values)) {
462  return $row[$values];
463  }
464 
465  $array = [];
466  foreach ($row as $key => $value) {
467  if (in_array($key, $values)) {
468  $array[$key] = $value;
469  }
470  }
471 
472  return $array;
473  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ concat()

ActiveRecordList::concat ( array  $fields,
string  $as 
)
Parameters
$as

Definition at line 264 of file class.ActiveRecordList.php.

References getArConcatCollection().

264  : self
265  {
266  $arConcat = new arConcat();
267  $arConcat->setAs($as);
268  $arConcat->setFields($fields);
269  $this->getArConcatCollection()->add($arConcat);
270 
271  return $this;
272  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ connector()

ActiveRecordList::connector ( arConnector  $arConnector)

Definition at line 330 of file class.ActiveRecordList.php.

330  : self
331  {
332  $this->connector = $arConnector;
333 
334  return $this;
335  }
connector(arConnector $arConnector)

◆ count()

ActiveRecordList::count ( )

Definition at line 354 of file class.ActiveRecordList.php.

References affectedRows().

354  : int
355  {
356  return $this->affectedRows();
357  }
+ Here is the call graph for this function:

◆ dateFormat()

ActiveRecordList::dateFormat ( string  $date_format = 'd.m.Y - H:i:s')

Definition at line 314 of file class.ActiveRecordList.php.

References setDateFormat().

314  :i:s'): self
315  {
316  $this->loaded = false;
317  $this->setDateFormat($date_format);
318 
319  return $this;
320  }
+ Here is the call graph for this function:

◆ debug()

ActiveRecordList::debug ( )

Definition at line 322 of file class.ActiveRecordList.php.

322  : self
323  {
324  $this->loaded = false;
325  $this->debug = true;
326 
327  return $this;
328  }

◆ first()

ActiveRecordList::first ( )

Definition at line 396 of file class.ActiveRecordList.php.

396  : ?\ActiveRecord
397  {
398  $this->load();
399 
400  $result = array_values($this->result);
401 
402  return array_shift($result);
403  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ get()

ActiveRecordList::get ( )
Returns
[]

Definition at line 377 of file class.ActiveRecordList.php.

References $result.

377  : array
378  {
379  $this->load();
380 
381  return $this->result;
382  }

◆ getAddidtionalParameters()

ActiveRecordList::getAddidtionalParameters ( )
Returns
mixed[]

Definition at line 568 of file class.ActiveRecordList.php.

References $addidtional_parameters.

Referenced by buildRow().

568  : array
569  {
571  }
+ Here is the caller graph for this function:

◆ getAR()

ActiveRecordList::getAR ( )

Definition at line 527 of file class.ActiveRecordList.php.

References $ar.

Referenced by __construct(), arConnectorDB\buildQuery(), buildRow(), getArConnector(), join(), and arConnectorSession\readSet().

527  : ?\ActiveRecord
528  {
529  return $this->ar;
530  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ getArConcatCollection()

ActiveRecordList::getArConcatCollection ( )

Definition at line 294 of file class.ActiveRecordList.php.

References $arConcatCollection.

Referenced by arConnectorDB\buildQuery(), and concat().

295  {
297  }
arConcatCollection $arConcatCollection
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ getArConnector()

ActiveRecordList::getArConnector ( )
protected

Definition at line 74 of file class.ActiveRecordList.php.

References arConnectorMap\get(), and getAR().

Referenced by affectedRows(), and buildRow().

74  : \arConnector
75  {
76  return arConnectorMap::get($this->getAR());
77  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static get(ActiveRecord $activeRecord)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getArHavingCollection()

ActiveRecordList::getArHavingCollection ( )

Definition at line 304 of file class.ActiveRecordList.php.

References $arHavingCollection.

Referenced by arConnectorDB\buildQuery().

305  {
307  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
arHavingCollection $arHavingCollection
+ Here is the caller graph for this function:

◆ getArJoinCollection()

ActiveRecordList::getArJoinCollection ( )

Definition at line 279 of file class.ActiveRecordList.php.

References $arJoinCollection.

Referenced by arConnectorDB\buildQuery(), and join().

280  {
282  }
arJoinCollection $arJoinCollection
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ getArLimitCollection()

ActiveRecordList::getArLimitCollection ( )

Definition at line 289 of file class.ActiveRecordList.php.

References $arLimitCollection.

Referenced by arConnectorDB\buildQuery(), and limit().

290  {
292  }
arLimitCollection $arLimitCollection
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ getArOrderCollection()

ActiveRecordList::getArOrderCollection ( )

Definition at line 284 of file class.ActiveRecordList.php.

References $arOrderCollection.

Referenced by arConnectorDB\buildQuery(), and orderBy().

285  {
287  }
arOrderCollection $arOrderCollection
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ getArray()

ActiveRecordList::getArray ( ?string  $key = null,
string|array|null  $values = null 
)
Parameters
string | null$keyshall a specific value be used as a key? if null then the 1. array key is just increasing from 0.
string | array$valueswhich values should be taken? if null all are given. If only a string is given then the result is an 1D array!
Returns
mixed[]|mixed[][]|int[]|string[]|null[]

Definition at line 419 of file class.ActiveRecordList.php.

References buildArray().

419  : array
420  {
421  $this->load();
422 
423  return $this->buildArray($key, $values);
424  }
buildArray(?string $key, $values)
+ Here is the call graph for this function:

◆ getArSelectCollection()

ActiveRecordList::getArSelectCollection ( )

Definition at line 299 of file class.ActiveRecordList.php.

References $arSelectCollection.

Referenced by __construct(), arConnectorDB\buildQuery(), and join().

300  {
302  }
arSelectCollection $arSelectCollection
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ getArWhereCollection()

ActiveRecordList::getArWhereCollection ( )

Definition at line 274 of file class.ActiveRecordList.php.

References $arWhereCollection.

Referenced by arConnectorDB\buildQuery(), arConnectorSession\readSet(), and where().

275  {
277  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
arWhereCollection $arWhereCollection
+ Here is the caller graph for this function:

◆ getClass()

ActiveRecordList::getClass ( )

Definition at line 369 of file class.ActiveRecordList.php.

References $class.

369  : string
370  {
371  return $this->class;
372  }

◆ getCollection()

ActiveRecordList::getCollection ( )

Definition at line 359 of file class.ActiveRecordList.php.

359  : self
360  {
361  return $this;
362  }

◆ getDateFormat()

ActiveRecordList::getDateFormat ( )

Definition at line 542 of file class.ActiveRecordList.php.

Referenced by buildRow().

542  : string
543  {
544  return $this->date_format ?? '';
545  }
+ Here is the caller graph for this function:

◆ getDebug()

ActiveRecordList::getDebug ( )

Definition at line 532 of file class.ActiveRecordList.php.

References $debug.

532  : bool
533  {
534  return $this->debug;
535  }

◆ getFirstFromLastQuery()

ActiveRecordList::getFirstFromLastQuery ( )
Deprecated:

Definition at line 387 of file class.ActiveRecordList.php.

References loadLastQuery().

387  : ?\ActiveRecord
388  {
389  $this->loadLastQuery();
390 
391  $result = array_values($this->result);
392 
393  return array_shift($result);
394  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ getLastQuery()

static ActiveRecordList::getLastQuery ( )
static

Definition at line 552 of file class.ActiveRecordList.php.

552  : ?string
553  {
554  return self::$last_query;
555  }

◆ getRaw()

ActiveRecordList::getRaw ( )

Definition at line 578 of file class.ActiveRecordList.php.

References $raw.

Referenced by buildRow().

578  : bool
579  {
580  return $this->raw;
581  }
+ Here is the caller graph for this function:

◆ hasSets()

ActiveRecordList::hasSets ( )

Definition at line 344 of file class.ActiveRecordList.php.

References affectedRows().

344  : bool
345  {
346  return $this->affectedRows() > 0;
347  }
+ Here is the call graph for this function:

◆ innerjoin()

ActiveRecordList::innerjoin ( string  $tablename,
  $on_this,
string  $on_external,
array  $fields = ['*'],
string  $operator = '=',
bool  $both_external = false 
)
Parameters
$tablename
$on_this
$on_external

Definition at line 250 of file class.ActiveRecordList.php.

References join(), and arJoin\TYPE_INNER.

Referenced by innerjoinAR().

257  : self {
258  return $this->join(arJoin::TYPE_INNER, $tablename, $on_this, $on_external, $fields, $operator, $both_external);
259  }
join(string $type, string $tablename, $on_this, string $on_external, array $fields=[' *'], string $operator='=', bool $both_external=false)
const TYPE_INNER
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ innerjoinAR()

ActiveRecordList::innerjoinAR ( ActiveRecord  $activeRecord,
  $on_this,
string  $on_external,
array  $fields = ['*'],
string  $operator = '=',
bool  $both_external = false 
)
Parameters
$on_this
$on_external

Definition at line 163 of file class.ActiveRecordList.php.

References ActiveRecord\getConnectorContainerName(), and innerjoin().

170  : self {
171  return $this->innerjoin(
172  $activeRecord->getConnectorContainerName(),
173  $on_this,
174  $on_external,
175  $fields,
176  $operator,
177  $both_external
178  );
179  }
getConnectorContainerName()
Return the Name of your Connector Table
innerjoin(string $tablename, $on_this, string $on_external, array $fields=[' *'], string $operator='=', bool $both_external=false)
+ Here is the call graph for this function:

◆ join()

ActiveRecordList::join ( string  $type,
string  $tablename,
  $on_this,
string  $on_external,
array  $fields = ['*'],
string  $operator = '=',
bool  $both_external = false 
)
protected
Parameters
$tablename
$on_this
$on_external
Exceptions
arException

Definition at line 187 of file class.ActiveRecordList.php.

References getAR(), getArJoinCollection(), getArSelectCollection(), and arException\LIST_JOIN_ON_WRONG_FIELD.

Referenced by innerjoin(), and leftjoin().

195  : self {
196  if (!$both_external && !$this->getAR()->getArFieldList()->isField($on_this)) {
198  }
199  $full_names = false;
200  foreach ($fields as $field_name) {
201  if ($this->getAR()->getArFieldList()->isField($field_name)) {
202  $full_names = true;
203  break;
204  }
205  }
206 
207  $arJoin = new arJoin();
208  $arJoin->setType($type);
209  $arJoin->setFullNames($full_names);
210  $arJoin->setTableName($tablename);
211  $arJoin->setOnFirstField($on_this);
212  $arJoin->setOnSecondField($on_external);
213  $arJoin->setOperator($operator);
214  $arJoin->setFields($fields);
215  $arJoin->setBothExternal($both_external);
216  $this->getArJoinCollection()->add($arJoin);
217 
218  foreach ($fields as $field) {
219  $arSelect = new arSelect();
220  $arSelect->setTableName($arJoin->getTableNameAs());
221  $arSelect->setFieldName($field);
222  $arSelect->setAs($arJoin->getTableNameAs() . '_' . $field);
223  $this->getArSelectCollection()->add($arSelect);
224  }
225 
226  return $this;
227  }
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const LIST_JOIN_ON_WRONG_FIELD
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ last()

ActiveRecordList::last ( )

Definition at line 405 of file class.ActiveRecordList.php.

405  : ?\ActiveRecord
406  {
407  $this->load();
408 
409  $result = array_values($this->result);
410 
411  return array_pop($result);
412  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ leftjoin()

ActiveRecordList::leftjoin ( string  $tablename,
  $on_this,
string  $on_external,
array  $fields = ['*'],
string  $operator = '=',
bool  $both_external = false 
)
Parameters
$tablename
$on_this
$on_external

Definition at line 234 of file class.ActiveRecordList.php.

References join(), and arJoin\TYPE_LEFT.

241  : self {
242  return $this->join(arJoin::TYPE_LEFT, $tablename, $on_this, $on_external, $fields, $operator, $both_external);
243  }
join(string $type, string $tablename, $on_this, string $on_external, array $fields=[' *'], string $operator='=', bool $both_external=false)
const TYPE_LEFT
+ Here is the call graph for this function:

◆ limit()

ActiveRecordList::limit ( int  $start,
int  $end 
)
Parameters
$start
$end
Exceptions
arException

Definition at line 148 of file class.ActiveRecordList.php.

References getArLimitCollection().

148  : self
149  {
150  $arLimit = new arLimit();
151  $arLimit->setStart($start);
152  $arLimit->setEnd($end);
153 
154  $this->getArLimitCollection()->add($arLimit);
155 
156  return $this;
157  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ loadLastQuery()

ActiveRecordList::loadLastQuery ( )
protected
Deprecated:

Definition at line 517 of file class.ActiveRecordList.php.

Referenced by getFirstFromLastQuery().

517  : void
518  {
519  // $this->readFromDb(self::$last_query);
520  }
+ Here is the caller graph for this function:

◆ orderBy()

ActiveRecordList::orderBy ( string  $order_by,
string  $order_direction = 'ASC' 
)
Parameters
$order_by
Exceptions
arException

Definition at line 133 of file class.ActiveRecordList.php.

References getArOrderCollection().

133  : self
134  {
135  $arOrder = new arOrder();
136  $arOrder->setFieldname($order_by);
137  $arOrder->setDirection($order_direction);
138  $this->getArOrderCollection()->add($arOrder);
139 
140  return $this;
141  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ raw()

ActiveRecordList::raw ( bool  $set_raw = true)

Definition at line 337 of file class.ActiveRecordList.php.

References setRaw().

Referenced by setRaw().

337  : self
338  {
339  $this->setRaw($set_raw);
340 
341  return $this;
342  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAddidtionalParameters()

ActiveRecordList::setAddidtionalParameters ( array  $addidtional_parameters)
Parameters
mixed[]$addidtional_parameters

Definition at line 560 of file class.ActiveRecordList.php.

References $addidtional_parameters.

Referenced by additionalParams().

560  : void
561  {
562  $this->addidtional_parameters = $addidtional_parameters;
563  }
+ Here is the caller graph for this function:

◆ setAR()

ActiveRecordList::setAR ( \ActiveRecord  $activeRecord)

Definition at line 522 of file class.ActiveRecordList.php.

Referenced by __construct().

522  : void
523  {
524  $this->ar = $activeRecord;
525  }
+ Here is the caller graph for this function:

◆ setArHavingCollection()

ActiveRecordList::setArHavingCollection ( \arHavingCollection  $arHavingCollection)

Definition at line 309 of file class.ActiveRecordList.php.

References $arHavingCollection.

309  : void
310  {
312  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
arHavingCollection $arHavingCollection

◆ setClass()

ActiveRecordList::setClass ( string  $class)

Definition at line 364 of file class.ActiveRecordList.php.

364  : void
365  {
366  $this->class = $class;
367  }

◆ setDateFormat()

ActiveRecordList::setDateFormat ( string  $date_format)

Definition at line 537 of file class.ActiveRecordList.php.

References $date_format.

Referenced by dateFormat().

537  : void
538  {
539  $this->date_format = $date_format;
540  }
+ Here is the caller graph for this function:

◆ setLastQuery()

static ActiveRecordList::setLastQuery ( string  $last_query)
static

Definition at line 547 of file class.ActiveRecordList.php.

References $last_query.

Referenced by arConnectorDB\buildQuery().

547  : void
548  {
549  self::$last_query = $last_query;
550  }
+ Here is the caller graph for this function:

◆ setRaw()

ActiveRecordList::setRaw ( bool  $raw)

Definition at line 573 of file class.ActiveRecordList.php.

References $raw, and raw().

Referenced by raw().

573  : void
574  {
575  $this->raw = $raw;
576  }
raw(bool $set_raw=true)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ where()

ActiveRecordList::where (   $where,
  $operator = null 
)
Parameters
$where
null$operator
Returns
$this|void
Exceptions
Exception

Definition at line 96 of file class.ActiveRecordList.php.

References getArWhereCollection(), and arWhere\TYPE_STRING.

96  : self
97  {
98  $this->loaded = false;
99  if (is_string($where)) {
100  $arWhere = new arWhere();
101  $arWhere->setType(arWhere::TYPE_STRING);
102  $arWhere->setStatement($where);
103  $this->getArWhereCollection()->add($arWhere);
104 
105  return $this;
106  }
107 
108  if (is_array($where)) {
109  foreach ($where as $field_name => $value) {
110  $arWhere = new arWhere();
111  $arWhere->setFieldname($field_name);
112  $arWhere->setValue($value);
113  if ($operator) {
114  if (is_array($operator)) {
115  $arWhere->setOperator($operator[$field_name]);
116  } else {
117  $arWhere->setOperator($operator);
118  }
119  }
120  $this->getArWhereCollection()->add($arWhere);
121  }
122 
123  return $this;
124  }
125 
126  throw new Exception('Wrong where Statement, use strings or arrays');
127  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const TYPE_STRING
+ Here is the call graph for this function:

Field Documentation

◆ $addidtional_parameters

array ActiveRecordList::$addidtional_parameters = []
protected

◆ $ar

ActiveRecord ActiveRecordList::$ar = null
protected

Definition at line 50 of file class.ActiveRecordList.php.

Referenced by getAR().

◆ $arConcatCollection

arConcatCollection ActiveRecordList::$arConcatCollection
protected

Definition at line 35 of file class.ActiveRecordList.php.

Referenced by getArConcatCollection().

◆ $arHavingCollection

arHavingCollection ActiveRecordList::$arHavingCollection
protected

Definition at line 37 of file class.ActiveRecordList.php.

Referenced by getArHavingCollection(), and setArHavingCollection().

◆ $arJoinCollection

arJoinCollection ActiveRecordList::$arJoinCollection
protected

Definition at line 32 of file class.ActiveRecordList.php.

Referenced by getArJoinCollection().

◆ $arLimitCollection

arLimitCollection ActiveRecordList::$arLimitCollection
protected

Definition at line 34 of file class.ActiveRecordList.php.

Referenced by getArLimitCollection().

◆ $arOrderCollection

arOrderCollection ActiveRecordList::$arOrderCollection
protected

Definition at line 33 of file class.ActiveRecordList.php.

Referenced by getArOrderCollection().

◆ $arSelectCollection

arSelectCollection ActiveRecordList::$arSelectCollection
protected

Definition at line 36 of file class.ActiveRecordList.php.

Referenced by getArSelectCollection().

◆ $arWhereCollection

arWhereCollection ActiveRecordList::$arWhereCollection
protected

Definition at line 31 of file class.ActiveRecordList.php.

Referenced by getArWhereCollection().

◆ $class

string ActiveRecordList::$class = ''
protected

Definition at line 39 of file class.ActiveRecordList.php.

Referenced by getClass().

◆ $connector

arConnector ActiveRecordList::$connector = null
protected

Definition at line 49 of file class.ActiveRecordList.php.

◆ $date_format

string ActiveRecordList::$date_format = null
protected

Definition at line 46 of file class.ActiveRecordList.php.

Referenced by setDateFormat().

◆ $debug

bool ActiveRecordList::$debug = false
protected

Definition at line 45 of file class.ActiveRecordList.php.

Referenced by getDebug().

◆ $last_query

string ActiveRecordList::$last_query = null
staticprotected

Definition at line 48 of file class.ActiveRecordList.php.

Referenced by setLastQuery().

◆ $loaded

bool ActiveRecordList::$loaded = false
protected

Definition at line 38 of file class.ActiveRecordList.php.

◆ $raw

bool ActiveRecordList::$raw = false
protected

Definition at line 51 of file class.ActiveRecordList.php.

Referenced by getRaw(), and setRaw().

◆ $result

array ActiveRecordList::$result = []
protected

Definition at line 43 of file class.ActiveRecordList.php.

Referenced by get().

◆ $result_array

array ActiveRecordList::$result_array = []
protected

Definition at line 44 of file class.ActiveRecordList.php.

Referenced by buildArray().


The documentation for this class was generated from the following file: