Piwik\API\Proxy::registerClass PHP Method

registerClass() public method

The module to be registered must be - a singleton (providing a getInstance() method) - the API file must be located in plugins/ModuleName/API.php for example plugins/Referrers/API.php The method will introspect the methods, their parameters, etc.
public registerClass ( string $className )
$className string ModuleName eg. "API"
    public function registerClass($className)
    {
        if (isset($this->alreadyRegistered[$className])) {
            return;
        }
        $this->includeApiFile($className);
        $this->checkClassIsSingleton($className);
        $rClass = new ReflectionClass($className);
        if (!$this->shouldHideAPIMethod($rClass->getDocComment())) {
            foreach ($rClass->getMethods() as $method) {
                $this->loadMethodMetadata($className, $method);
            }
            $this->setDocumentation($rClass, $className);
            $this->alreadyRegistered[$className] = true;
        }
    }