Piwik\Plugins\API\WidgetMetadata::buildSubcategoryMetadata PHP Method

buildSubcategoryMetadata() private method

private buildSubcategoryMetadata ( Subcategory | null $subcategory ) : array
$subcategory Piwik\Category\Subcategory | null
return array
    private function buildSubcategoryMetadata($subcategory)
    {
        if (!isset($subcategory)) {
            return null;
        }
        return array('id' => (string) $subcategory->getId(), 'name' => Piwik::translate($subcategory->getName()), 'order' => $subcategory->getOrder());
    }