ILIAS
release_8 Revision v8.23
◀ ilDoc Overview
class.arFactory.php
Go to the documentation of this file.
1
<?php
2
3
/******************************************************************************
4
*
5
* This file is part of ILIAS, a powerful learning management system.
6
*
7
* ILIAS is licensed with the GPL-3.0, you should have received a copy
8
* of said license along with the source code.
9
*
10
* If this is not the case or you just want to try ILIAS, you'll find
11
* us at:
12
* https://www.ilias.de
13
* https://github.com/ILIAS-eLearning
14
*
15
*****************************************************************************/
21
class
arFactory
22
{
27
public
static
function
getInstance(
string
$class_name, $primary_key = 0, array $additional_arguments = array()):
\ActiveRecord
28
{
29
$ref =
new
ReflectionClass
($class_name);
30
if
($ref->isInstantiable()) {
32
$obj = $ref->newInstanceArgs(array_merge(array($primary_key), $additional_arguments));
33
if
(empty($primary_key)) {
34
$obj = clone($obj);
35
}
36
}
else
{
37
throw
new
arException
(
arException::PRIVATE_CONTRUCTOR
);
38
}
39
40
return
$obj;
41
}
42
}
ActiveRecord
Class ActiveRecord.
Definition:
class.ActiveRecord.php:24
arFactory
Class arFactory.
Definition:
class.arFactory.php:21
arException\PRIVATE_CONTRUCTOR
const PRIVATE_CONTRUCTOR
Definition:
class.arException.php:33
arException
Class arException.
Definition:
class.arException.php:22
ReflectionClass
Services
ActiveRecord
Factory
class.arFactory.php
Generated on Wed Sep 3 2025 22:01:48 for ILIAS by
1.8.13 (using
Doxyfile
)