Pimcore\API\Plugin\Broker::getPlugin PHP Method

getPlugin() public method

public getPlugin ( $class ) : array | boolean
$class
return array | boolean
    public function getPlugin($class)
    {
        $found = [];
        foreach ($this->_plugins as $plugin) {
            $type = get_class($plugin);
            if ($class == $type) {
                $found[] = $plugin;
            }
        }
        switch (count($found)) {
            case 0:
                return false;
            case 1:
                return $found[0];
            default:
                return $found;
        }
    }