Returns the number of active modules linked to a hook

@return int Number of active modules
343438
public function getNumberActiveModules(){
		if(HookProvider::getInstance()->isModuleOperational()){
			$sqlquery = '';
			$sqlparams = array($this->hook_function);
			if($this->hook_context != 'all') {
				$sqlparams = array($this->hook_function, $this->hook_context);
				$sqlquery = " OR majh_hook_context=?";
			}
			$module_names=Database::prepare(
					"SELECT majh_module_name AS modules FROM `##maj_hooks`".
					" WHERE majh_hook_function = ? AND (majh_hook_context='all'".$sqlquery.") AND majh_status='enabled'"
			)->execute($sqlparams)->fetchOneColumn();
			return count($module_names);
		}
		return 0;
	}
925865
protected function loadHooks() {
		$hooks = [];
		if(file_exists($this->getPath().'/Hook/')) {
			foreach(glob($this->getPath().'/Hook/*.php') as $filename) {
				$class = \Asgard\Common\Tools::loadClassFile($filename);
				if(is_subclass_of($class, 'Asgard\Hook\HookContainer'))
					$hooks = array_merge_recursive($hooks, $this->hooksAnnotationReader->fetchHooks($class));
			}
		}
		return $hooks;
	}
1025766
protected function getTotalCount()
    {
        $query = $this->modelRepository->query();

        $this->applyListParentToQuery($query);

        return $query->count();
    }
7078
public static function getExecuteCount(string $hook)
    {
        return isset(self::$counters[$hook]) ? self::$counters[$hook] : 0;
    }
653738
protected function call_hook()
    {
        $args = func_get_args();
        $name = array_shift($args);

        if ($this->has_hook($name)) {
            $callback = $this->_hooks[$name];

            if ( ! is_callable($callback)) {
                return false;
            }

            if (is_php('5.4.0') and $callback instanceof Closure) {
                $callback->bindTo($this);
            }

            return call_user_func_array($callback, $args);
        }

        return false;
    }
943632
public function getActiveViewPlugins()
    {
        $ret = $this->_getSetting('plugins');
        $d = $this->getData();
        if ($d->isPage) {
            while ($d) {
                foreach (Kwc_Abstract::getSetting($d->componentClass, 'pluginsInherit') as $i) {
                    if (!in_array($i, $ret)) $ret[] = $i;
                }
                $d = $d->parent;
            }
        }
        return $ret;
    }
430262
public int getNumberOfActiveMessages()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.entry(tc, "getNumberOfActiveMessages");
    int activeMessages = 
      (int)_sourceStream.countAllMessagesOnStream();
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.exit(tc, "getNumberOfActiveMessages", new Integer(activeMessages));      
    return activeMessages;
  }
886992
public function getSumChildCount(): int
    {
        $count = count($this->children);

        foreach ($this->children as $node) {
            $count += $node->getChildCount();
        }

        return $count;
    }
832244
public function actionIndex(): int
    {
        $this->disableLogging();

        $configurations = [];
        foreach ($this->getDataTypes() as $dataTypeHandle) {
            $dataType = $this->module->getDataType($dataTypeHandle);
            if (null == $dataType) {
                continue;
            }

            $mapper = $dataType->getMapperHandle();
            if (!$this->module->checkMapper($mapper)) {
                continue;
            }

            $records = $dataType->getRecords();
            $configurations[$dataTypeHandle] = $this->module->$mapper->export($records);
        }

        // Load override file.
        $overrideData = [];
        if (file_exists($this->overrideFile)) {
            // Parse data in the overrideFile if available.
            $overrideData = Data::parseYamlFile($this->overrideFile);
        }

        // Export the configuration to a single file.
        if ($this->getStorageType() === self::SINGLE_FILE) {
            $this->exportToSingle($configurations, $overrideData);
        }

        // Export the configuration to multiple yaml files.
        if ($this->getStorageType() === self::MULTIPLE_FILES) {
            $this->exportToMultiple($configurations, $overrideData);
        }

        return 0;
    }
590457
public static function getAvailableModules()
    {
        if (!self::$_initialized) {
            self::init();
        }

        $result = [];

        foreach (self::$_modules as $ns => $module) {
            $result[] = [
                'namespace' => $ns,
                'name' => $module->name(),
                'description' => $module->description(),
                'group' => $module->group(),
                'icon' => $module->icon()
            ];
        }

        return $result;
    }
51290
protected function count_attachments() {

        $fs = get_file_storage();
        $files = $fs->get_area_files($this->get_context()->id, 'mod_assign', ASSIGN_INTROATTACHMENT_FILEAREA,
                        0, 'id', false);

        return count($files);
    }
1348959
public static function getRegisteredHooks()
    {
        $subscribed = array_keys(self::$hooks);
        $called = array_keys(self::$counters);
        $all = array_merge($subscribed, $called);
        return array_unique($all);
    }
1020643
public function getCount()
    {
        if ($this->count === NULL) {
            $this->count = $this->getModel()->getCount();
        }

        return $this->count;
    }
480370
public function get_active()
    {
        if ($this->active !== null) {
            return $this->active;
        }

        if (!$this->sieve) {
            return $this->_set_error(self::ERROR_INTERNAL);
        }

        return $this->active = $this->sieve->getActive();
    }
782858
protected function get_module_name() {
        if (isset(self::$modulename)) {
            return self::$modulename;
        }
        self::$modulename = get_string('modulename', 'assign');
        return self::$modulename;
    }
210786
public static function getModulesByName($hook)
    {
        return  \Cache::remember('hook'.$hook,100000,function() use($hook){
            return \DB::table('modules AS m')->select('m.*','hm.position')
                ->leftJoin('hooks_modules AS hm', 'hm.id_module', '=', 'm.id')
                ->leftJoin('hooks AS h', 'h.id', '=', 'hm.id_hook')
                ->where('h.name', $hook)
                ->where('m.active', '1')
                ->orderBy('hm.position', 'ASC')
                ->get();
        });
    }
749038
public function getModuleHooks($module)
    {
        $hooks = $this->getHooksDefinitionsFromSugar($module);
        if (empty($hooks)) {
            return array();
        }

        $sortedHooks = array();
        $hooksDef = $this->getHooksDefinitionsFromFiles($module);

        // Process hooks in a specific order
        foreach ($this->modulesLogicHooksDef as $type => $hookDesc) {
            if (!array_key_exists($type, $hooks) || empty($hooks[$type])) {
                continue;
            }

            $i = 0;
            foreach ($hooks[$type] as $hook) {
                $num = str_pad($hook[0], 20, 0, \STR_PAD_LEFT) . '_' . $i;
                $sortedHooks[$type][$num] = array(
                    'Weight' => $hook[0],
                    'Description' => $hook[1],
                    'File' => $hook[2],
                    'Class' => $hook[3],
                    'Method' => $hook[4],
                    'Defined In' => $this->findHookInDefinition($hooksDef, $type, $hook[2], $hook[3], $hook[4]),
                );
                $i++;
            }
            ksort($sortedHooks[$type]);
            unset($hooks[$type]);
        }

        // Have I lost some hooks ?
        if (!empty($hooks)) {
            foreach ($hooks as $type => $hooks) {
                foreach ($hooks as $hook) {
                    if (empty($hook)) {
                        continue;
                    }
                    $sortedHooks[$type][] = array(
                        'Weight' => $hook[0],
                        'Description' => $hook[1],
                        'File' => $hook[2],
                        'Class' => $hook[3],
                        'Method' => $hook[4],
                        'Defined In' => $this->findHookInDefinition($hooksDef, $type, $hook[2], $hook[3], $hook[4]),
                    );
                }
            }
        }

        return $sortedHooks;
    }