CRM-14478 - ManagedEntities - Add support for 'cleanup' policy ("unused")
[civicrm-core.git] / Civi / Core / Container.php
index eb0b13f11d5c8b01bc6761be50812a46f53a0ba5..f70369ad150eb5a373ef5c162ea39e32e720bd70 100644 (file)
@@ -13,6 +13,10 @@ use Symfony\Component\DependencyInjection\Reference;
 
 // TODO use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
 
+/**
+ * Class Container
+ * @package Civi\Core
+ */
 class Container {
 
   const SELF = 'civi_container_factory';
@@ -23,10 +27,11 @@ class Container {
   private static $singleton;
 
   /**
+   * @param bool $reset whether to forcibly rebuild the entire container
    * @return \Symfony\Component\DependencyInjection\TaggedContainerInterface
    */
-  public static function singleton() {
-    if (self::$singleton === NULL) {
+  public static function singleton($reset = FALSE) {
+    if ($reset || self::$singleton === NULL) {
       $c = new self();
       self::$singleton = $c->createContainer();
     }