hendrikmaus/reynaldo

View on GitHub
src/Elements/MasterCategoryElement.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
<?php

namespace Hmaus\Reynaldo\Elements;

class MasterCategoryElement extends BaseElement implements ApiElement, ApiDescriptionRoot
{
    public function getApiTitle()
    {
        return $this->getTitle();
    }

    public function getApiMetaData()
    {
        $meta = [];

        foreach ($this->attributes['meta'] as $member) {
            $meta[$member['content']['key']['content']] = $member['content']['value']['content'];
        }

        return $meta;
    }

    public function getResourceGroups()
    {
        return $this->getElementsByType(ResourceGroupElement::class);
    }

    public function getApiDocumentDescription()
    {
        return $this->getCopyText();
    }

    public function getDataStructureCategory()
    {
        return $this->getFirstElementByType(DataStructureCategoryElement::class);
    }
}