System\Traits\PropertyContainer

Overview

PropertyContainer adds properties and methods for classes that could define properties, like components or report widgets.


Protected Properties

protected array $properties

properties contains the object property values.


Public Methods

public defineProperties()

public defineProperties(): void

defineProperties used by this class. This method should be used as an override in the extended class.

public getProperties()

public getProperties(): array 

getProperties returns all properties.

public getPropertyOptions()

public getPropertyOptions(string $property): array 

getPropertyOptions returns options for multi-option properties (drop-downs, etc.)

public property()

public property(string $name, ?string $default = null): ?string 

property returns a defined property value or default if one is not set.

public setProperties()

public setProperties(array $properties): void 

setProperties for multiple values

public setProperty()

public setProperty(string $name, mixed $value): void 

setProperty for a single value

public validateProperties()

public validateProperties(array $properties): array 

validateProperties against the defined properties of the class. This method also sets default properties.