/**
  * Get an instance
  */
 public static function singleton($fresh = FALSE)
 {
     static $singleton;
     if ($fresh || !$singleton) {
         $declarations = array();
         CRM_Utils_Hook::managed($declarations);
         $singleton = new CRM_Core_ManagedEntities(CRM_Core_Module::getAll(), $declarations);
     }
     return $singleton;
 }
Пример #2
0
 /**
  * Get an instance
  */
 public static function singleton($fresh = FALSE)
 {
     static $singleton;
     if ($fresh || !$singleton) {
         $declarations = array();
         foreach (CRM_Core_Component::getEnabledComponents() as $component) {
             $declarations = array_merge($declarations, $component->getManagedEntities());
         }
         CRM_Utils_Hook::managed($declarations);
         $singleton = new CRM_Core_ManagedEntities(CRM_Core_Module::getAll(), $declarations);
     }
     return $singleton;
 }
 public function getDeclarations()
 {
     if ($this->declarations === NULL) {
         $this->declarations = array();
         foreach (CRM_Core_Component::getEnabledComponents() as $component) {
             /** @var CRM_Core_Component_Info $component */
             $this->declarations = array_merge($this->declarations, $component->getManagedEntities());
         }
         CRM_Utils_Hook::managed($this->declarations);
         $this->declarations = self::cleanDeclarations($this->declarations);
     }
     return $this->declarations;
 }