HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/marisrental/boldt.tech/app/Komma/Kms/Core/Sections/AbstractSectionTabItem.php
<?php declare(strict_types=1);

namespace App\Komma\Kms\Core\Sections;
use App\Komma\Kms\Core\Attributes\Attribute;

/**
 * Links a piece of data (can be anything) to a SectionTabGroups value.
 *
 * Class AbstractSectionTabItem
 * @package App\Komma\Kms\Core\Sections
 */
abstract class AbstractSectionTabItem
{
    /** @var Attribute $attribute*/
    private $attribute;

    /** @var string $group One of the SectionTabGroups group constants */
    private $group;

    /**
     * @return Attribute
     */
    public function getAttribute()
    {
        return $this->attribute;
    }

    /**
     * @param Attribute $attribute
     * @return AbstractSectionTabItem
     */
    public function setAttribute(Attribute $attribute): AbstractSectionTabItem
    {
        $this->attribute = $attribute;
        return $this;
    }

    /**
     * @return string Corresponds to one of the SectionTabGroups group constants
     */
    public function getGroup(): string
    {
        return $this->group;
    }

    /**
     * @param string $group One of the SectionTabGroups group constants
     * @return $this
     */
    public function setGroup(string $group): AbstractSectionTabItem
    {
        if(!SectionTabGroups::isValidGroup($group)) throw new \InvalidArgumentException("The group '".$group."' isn't, but must be, one that is defined in the SectionTabsGroup class");
        $this->group = $group;

        return $this;
    }
}