ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.arFactory.php
Go to the documentation of this file.
1<?php
2
25{
29 public static function getInstance(
30 string $class_name,
31 mixed $primary_key = 0,
32 array $additional_arguments = []
33 ): \ActiveRecord {
34 $reflectionClass = new ReflectionClass($class_name);
35 if ($reflectionClass->isInstantiable()) {
37 $obj = $reflectionClass->newInstanceArgs(array_merge([$primary_key], $additional_arguments));
38 if (empty($primary_key)) {
39 $obj = clone($obj);
40 }
41 } else {
43 }
44
45 return $obj;
46 }
47}
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 PRIVATE_CONTRUCTOR
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...