/** Datei: library/ARUNOX/API/PHP/Attributes/Database/Options/Label.php **/ * @copyright 2025 ARUNOX * @version 1.1.0 * * @since 1.0.0 File is created */ namespace ARUNOX\API\PHP\Attributes\Database\Options; use Attribute; use ARUNOX\API\PHP; #[Attribute( Attribute::TARGET_CLASS | Attribute::TARGET_CLASS_CONSTANT )] class Label extends PHP\Attributes\Attribute { /* ### VARIABLES ################################################ # */ protected static null|string $__DEFAULT = "getSingular"; /* ### PUNLIC FUNCTIONS ######################################### # */ public function getLabel() : array { return [ "singular" => $this->singular, "plural" => $this->plural, "group" => $this->group, ]; } public function getSingular( null|string $label = NULL, ...$tokens ) : string { return $this->getLabelSingular( $label, ...$tokens ); } public function getLabelSingular( null|string $label = NULL, ...$tokens ) : string { return $this->resolveLabel( "singular", $label, "Entry", ...$tokens ); } public function getPlural( null|string $label = NULL, ...$tokens ) : string { return $this->getLabelPlural( $label, ...$tokens ); } public function getLabelPlural( null|string $label = NULL, ...$tokens ) : string { return $this->resolveLabel( "plural", $label, "Entries", ...$tokens ); } public function getLabelGroup( null|string $label = NULL, ...$tokens ) : string { return $this->resolveLabel( "group", $label, "Overview", ...$tokens ); } /* ### PROTECTED FUNCTIONS ###################################### # */ /* ### PRIVATE FUNCTIONS ######################################## # */ private function resolveLabel( null|string $column = NULL, null|string $label = NULL, null|string $fallback = NULL, ...$tokens ) : string|array { if( $column ) { if( !$label ) return __( $this->getLabel()[ $column ] ?? $fallback ); return __( $label, $this->getLabel()[ $column ] ?? $fallback, ...$tokens ); } else return $this->getLabel() ?? []; } /* ### MAGIC FUNCTIONS ########################################## # */ public function __construct( protected string $singular, protected null|string $plural = NULL, protected null|string $group = NULL ){ if( !$plural ) $this->plural = $singular; if( !$group ) $this->group = $this->plural; } } /** Datei: library/ARUNOX/API/PHP/Attributes/Database/Options/Color.php **/ * @copyright 2025 ARUNOX * @version 1.1.0 * * @since 1.0.0 File is created */ namespace ARUNOX\API\PHP\Attributes\Database\Options; use Attribute; use ARUNOX\API\PHP; use ARUNOX\Plugins\REST; #[Attribute( Attribute::TARGET_CLASS | Attribute::TARGET_CLASS_CONSTANT )] class Color extends PHP\Attributes\Attribute { /* ### VARIABLES ################################################ # */ protected static null|string $__DEFAULT = "getColor"; /* ### PUBLIC FUNCTIONS ######################################### # */ public function getColor() { return $this->CONFIG; } /* ### PROTECTED FUNCTIONS ###################################### # */ /* ### MAGIC FUNCTIONS ########################################## # */ } /** Datei: library/ARUNOX/API/PHP/Attributes/Database/Options/Toggle.php **/ * @copyright 2025 ARUNOX * @version 1.1.0 * * @since 1.0.0 File is created */ namespace ARUNOX\API\PHP\Attributes\Database\Options; use Attribute; use ARUNOX\API\PHP; use ARUNOX\Plugins\REST; #[Attribute( Attribute::TARGET_CLASS_CONSTANT )] class Toggle extends PHP\Attributes\Attribute { /* ### VARIABLES ################################################ # */ protected static null|string $__DEFAULT = "getToggle"; /* ### PUBLIC FUNCTIONS ######################################### # */ public function getToggle() { return $this->CONFIG; } /* ### PROTECTED FUNCTIONS ###################################### # */ /* ### MAGIC FUNCTIONS ########################################## # */ } /** Datei: library/ARUNOX/API/PHP/Attributes/Database/Options/Icon.php **/ * @copyright 2025 ARUNOX * @version 1.1.0 * * @since 1.0.0 File is created */ namespace ARUNOX\API\PHP\Attributes\Database\Options; use Attribute; use ARUNOX\API\PHP; use ARUNOX\Plugins\REST; #[Attribute( Attribute::TARGET_CLASS | Attribute::TARGET_CLASS_CONSTANT )] class Icon extends PHP\Attributes\Attribute { /* ### VARIABLES ################################################ # */ protected static null|string $__DEFAULT = "getIcon"; /* ### PUBLIC FUNCTIONS ######################################### # */ public function getIcon() { return $this->CONFIG; } /* ### PROTECTED FUNCTIONS ###################################### # */ /* ### MAGIC FUNCTIONS ########################################## # */ }