File: D:/HostingSpaces/SBogers95/rentman.io/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
*/
abstract class AbstractSectionTabItem
{
/** @var Attribute */
private $attribute;
/** @var string 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): self
{
$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): self
{
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;
}
}