public function getModulesDependOf($active = true)
    {
        $code = $this->getModuleDefinition()->getCode();
        $query = ModuleQuery::create();
        $dependantModules = [];

        if (true === $active) {
            $query->findByActivate(1);
        } elseif (false === $active) {
            $query->findByActivate(0);
        }

        $modules = $query->find();

        /** @var Module $module */
        foreach ($modules as $module) {
            try {
                $validator = new ModuleValidator($module->getAbsoluteBaseDir());

                $definition = $validator->getModuleDefinition();
                $dependencies = $definition->getDependencies();

                if (\count($dependencies) > 0) {
                    foreach ($dependencies as $dependency) {
                        if ($dependency[0] == $code) {
                            $dependantModules[] = [
                                'code' => $definition->getCode(),
                                'version' => $dependency[1]
                            ];

                            break;
                        }
                    }
                }
            } catch (\Exception $ex) {
                ;
            }
        }

        return $dependantModules;
    }
public function getModulesDependOf($active = true)
    {
        $code = $this->getModuleDefinition()->getCode();
        $query = ModuleQuery::create();
        $dependantModules = [];

        if (true === $active) {
            $query->findByActivate(1);
        } elseif (false === $active) {
            $query->findByActivate(0);
        }

        $modules = $query->find();

        /** @var Module $module */
        foreach ($modules as $module) {
            try {
                $validator = new ModuleValidator($module->getAbsoluteBaseDir());

                $definition = $validator->getModuleDefinition();
                $dependencies = $definition->getDependencies();

                if (\count($dependencies) > 0) {
                    foreach ($dependencies as $dependency) {
                        if ($dependency[0] == $code) {
                            $dependantModules[] = [
                                'code' => $definition->getCode(),
                                'version' => $dependency[1]
                            ];

                            break;
                        }
                    }
                }
            } catch (\Exception $ex) {
                ;
            }
        }

        return $dependantModules;
    }
public function getModulesDependOf ( $ active = true ) { $ code = $ this -> getModuleDefinition ( ) -> getCode ( ) ; $ query = ModuleQuery :: create ( ) ; $ dependantModules = [ ] ; if ( true === $ active ) { $ query -> findByActivate ( 1 ) ; } elseif ( false === $ active ) { $ query -> findByActivate ( 0 ) ; } $ modules = $ query -> find ( ) ; /** @var Module $module */ foreach ( $ modules as $ module ) { try { $ validator = new ModuleValidator ( $ module -> getAbsoluteBaseDir ( ) ) ; $ definition = $ validator -> getModuleDefinition ( ) ; $ dependencies = $ definition -> getDependencies ( ) ; if ( \ count ( $ dependencies ) > 0 ) { foreach ( $ dependencies as $ dependency ) { if ( $ dependency [ 0 ] == $ code ) { $ dependantModules [ ] = [ 'code' => $ definition -> getCode ( ) , 'version' => $ dependency [ 1 ] ] ; break ; } } } } catch ( \ Exception $ ex ) { ; } } return $ dependantModules ; }
Get an array of modules that depend of the current module

@param  bool|null $active if true only search in activated module, false only deactivated and null on all modules
@return array     array of array with `code` which is the module code that depends of this current module and
`version` which is the required version of current module
Get an array of modules that depend of the current module