ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
class.arFactory.php
Go to the documentation of this file.
1
<?
php
2
require_once(dirname(__FILE__) .
'/../Exception/class.arException.php'
);
3
10
class
arFactory
11
{
12
21
public
static
function
getInstance($class_name, $primary_key = 0, $additional_arguments = array())
22
{
26
$ref =
new
ReflectionClass
($class_name);
27
if
($ref->isInstantiable()) {
28
$obj = $ref->newInstanceArgs(array_merge(array( $primary_key ), $additional_arguments));
29
if
($primary_key == 0) {
30
$obj = clone($obj);
31
}
32
}
else
{
33
throw
new
arException
(
arException::PRIVATE_CONTRUCTOR
);
34
}
35
36
return
$obj;
37
}
38
}
arFactory
Class arFactory.
Definition:
class.arFactory.php:10
arException\PRIVATE_CONTRUCTOR
const PRIVATE_CONTRUCTOR
Definition:
class.arException.php:22
arException
Class arException.
Definition:
class.arException.php:11
ReflectionClass
php
Services
ActiveRecord
Factory
class.arFactory.php
Generated on Thu Feb 27 2025 19:01:51 for ILIAS by
1.8.13 (using
Doxyfile
)