/** Datei: plugins/logs/library/ARUNOX/API/PHP/Attributes/Logs/Rules/Update.php **/ * @copyright 2025 ARUNOX * @version 1.0.0 * * @since 1.0.0 File is created */ namespace ARUNOX\API\PHP\Attributes\Logs\Rules; use Attribute; use ARUNOX\API\PHP; use ARUNOX\Database\Attribute\Options; #[Attribute( Attribute::TARGET_CLASS | Attribute::IS_REPEATABLE )] class Update extends PHP\Attributes\Attribute { /* ### VARIABLES ################################################ # */ protected array $RULES = []; /* ### PUBLIC FUNCTIONS ######################################### # */ public function add( string $column, null|string $message = NULL, null|string|array $options = NULL ) { if( is_string( $options ) ) { if( class_exists( $options ) ) { if( method_exists( $options, "getAsOptions" ) ) { $options = $options::getAsOptions(); } if( is_a( $options, Options::class, TRUE ) ) { $options = $options::getAll(); } } else $options = NULL; } $this->RULES[ $column ] = [ "message" => $message, "options" => $options, ]; } /* ### PUBLIC STATIC LOG FUNCTIONS ############################## # */ public function getLogRulesUpdated( null|int $id = NULL ) { return $this->RULES; } /* ### MAGIC FUNCTIONS ######################################### # */ /** * @param string $column * @param string|null $message * @param string|array|null $options */ public function __construct( string $column, null|string $message = NULL, null|string|array $options = NULL ) {} } /** Datei: plugins/logs/library/ARUNOX/API/PHP/Attributes/Logs/Rules/Create.php **/ * @copyright 2025 ARUNOX * @version 1.0.0 * * @since 1.0.0 File is created */ namespace ARUNOX\API\PHP\Attributes\Logs\Rules; use Attribute; use ARUNOX\API\PHP; #[Attribute( Attribute::TARGET_CLASS | Attribute::IS_REPEATABLE )] class Create extends PHP\Attributes\Attribute { /* ### VARIABLES ################################################ # */ protected array $RULES = []; /* ### PUBLIC FUNCTIONS ######################################### # */ public function getLogRulesCreated( null|int $id = NULL ) { return $this->RULES; } public function add( null|string $column = "__self", null|string|array $message = NULL ) { $this->RULES[ $column ] = $message ?? []; } /* ################################################################ # */ /* ### DEFINITION FOR IDE ####################################### # */ /* ################################################################ # */ /** * @param string|null $column * @param string|null $message */ public function __construct( null|string $column = "__self", null|string|array $message = NULL ) {} }