public function requiredBy()
    {
        if ($cache = $this->config('required_by')) {
            return collection($cache);
        }

        Plugin::dropCache();
        $out = [];
        $plugins = Plugin::get()->filter(function ($v, $k) {
            return $v->name() !== $this->name();
        });

        foreach ($plugins as $plugin) {
            if ($dependencies = $plugin->dependencies($plugin->name)) {
                $packages = array_map(function ($item) {
                    list(, $package) = packageSplit($item, true);

                    return strtolower($package);
                }, array_keys($dependencies));

                if (in_array(strtolower($this->name()), $packages)) {
                    $out[] = $plugin;
                }
            }
        }

        $this->config('required_by', $out);

        return collection($out);
    }
public function requiredBy()
    {
        if ($cache = $this->config('required_by')) {
            return collection($cache);
        }

        Plugin::dropCache();
        $out = [];
        $plugins = Plugin::get()->filter(function ($v, $k) {
            return $v->name() !== $this->name();
        });

        foreach ($plugins as $plugin) {
            if ($dependencies = $plugin->dependencies($plugin->name)) {
                $packages = array_map(function ($item) {
                    list(, $package) = packageSplit($item, true);

                    return strtolower($package);
                }, array_keys($dependencies));

                if (in_array(strtolower($this->name()), $packages)) {
                    $out[] = $plugin;
                }
            }
        }

        $this->config('required_by', $out);

        return collection($out);
    }
public function requiredBy ( ) { if ( $ cache = $ this -> config ( 'required_by' ) ) { return collection ( $ cache ) ; } Plugin :: dropCache ( ) ; $ out = [ ] ; $ plugins = Plugin :: get ( ) -> filter ( function ( $ v , $ k ) { return $ v -> name ( ) !== $ this -> name ( ) ; } ) ; foreach ( $ plugins as $ plugin ) { if ( $ dependencies = $ plugin -> dependencies ( $ plugin -> name ) ) { $ packages = array_map ( function ( $ item ) { list ( , $ package ) = packageSplit ( $ item , true ) ; return strtolower ( $ package ) ; } , array_keys ( $ dependencies ) ) ; if ( in_array ( strtolower ( $ this -> name ( ) ) , $ packages ) ) { $ out [ ] = $ plugin ; } } } $ this -> config ( 'required_by' , $ out ) ; return collection ( $ out ) ; }
Gets a collection list of plugin that depends on this plugin.

@return \Cake\Collection\Collection List of plugins
Gets a collection list of plugin that depends on this plugin .