/** * Force creation of a singleton * * @param ObjectConfig $config A ObjectConfig object with configuration options * @param ObjectManagerInterface $manager A ObjectInterface object * @return DispatcherInterface */ public static function getInstance(ObjectConfigInterface $config, ObjectManagerInterface $manager) { //Add the object alias to allow easy access to the singleton $manager->registerAlias($config->object_identifier, 'dispatcher.fragment'); //Merge alias configuration into the identifier $config->append($manager->getIdentifier('dispatcher.fragment')->getConfig()); //Instantiate the class $instance = new static($config); return $instance; }