1<?php 2 3/* Copyright (c) 2015 Richard Klees <richard.klees@concepts-and-training.de> Extended GPL, see docs/LICENSE */ 4 5require_once("./Services/Object/classes/class.ilObjectFactory.php"); 6 7/** 8 * Class ilObjectFactoryWrapper. 9 * 10 * Wraps around static class ilObjectFactory to make the object factory 11 * exchangeable in ilObjStudyProgramm for testing purpose. 12 * 13 * @author : Richard Klees <richard.klees@concepts-and-training.de> 14 */ 15class ilObjectFactoryWrapper 16{ 17 public static $instance = null; 18 19 public static function singleton() 20 { 21 if (self::$instance === null) { 22 self::$instance = new ilObjectFactoryWrapper(); 23 } 24 return self::$instance; 25 } 26 27 public function getInstanceByRefId($a_ref_id, $stop_on_error = true) 28 { 29 return ilObjectFactory::getInstanceByRefId($a_ref_id, $stop_on_error); 30 } 31} 32