src/Plugin.php
public static function getInstance($name)
    {
        if (!self::loaded($name)) {
            throw new MissingPluginException(['plugin' => $name]);
        }

        if (!Arr::key($name, self::$_pluginsList)) {
            $slug  = Str::low($name);
            $table = TableRegistry::get('Extensions.Extensions');

            $entity = $table
                ->find()
                ->where([
                    'slug' => $slug,
                    'type' => EXT_TYPE_PLUGIN
                ])
                ->first();

            self::$_pluginsList[$name] = $entity;
        }

        return self::$_pluginsList[$name];
    }
public static function getInstance($name)
    {
        if (!self::loaded($name)) {
            throw new MissingPluginException(['plugin' => $name]);
        }

        if (!Arr::key($name, self::$_pluginsList)) {
            $slug  = Str::low($name);
            $table = TableRegistry::get('Extensions.Extensions');

            $entity = $table
                ->find()
                ->where([
                    'slug' => $slug,
                    'type' => EXT_TYPE_PLUGIN
                ])
                ->first();

            self::$_pluginsList[$name] = $entity;
        }

        return self::$_pluginsList[$name];
    }
public static function getInstance ( $ name ) { if ( ! self :: loaded ( $ name ) ) { throw new MissingPluginException ( [ 'plugin' => $ name ] ) ; } if ( ! Arr :: key ( $ name , self :: $ _pluginsList ) ) { $ slug = Str :: low ( $ name ) ; $ table = TableRegistry :: get ( 'Extensions.Extensions' ) ; $ entity = $ table -> find ( ) -> where ( [ 'slug' => $ slug , 'type' => EXT_TYPE_PLUGIN ] ) -> first ( ) ; self :: $ _pluginsList [ $ name ] = $ entity ; } return self :: $ _pluginsList [ $ name ] ; }
Get plugin extension instance.

@param   string $name Plugin name.
@return  Entity
Get plugin extension instance .