Property facade

From Sunhill Framework Documentation

The Property facade is a laravel facade that provides methods to deal with the management of properties.

Properties

PropertyQuery(): BasicQuery

Creates a property query and returns its instance.

clearRegisteredProperties()

Clears all registered properties

registerProperty(string $property, ?string $alias = null)

Registered a new property to the manager

isPropertyRegistered($property): bool

Returns true, when the given name or class was already registered

getNamespaceOfProperty($property)

Returns the full classname with namespace of the given property

getNameOfProperty($property)

Returns the name of the given property

propertyHasMethod($property, $method)

Testss if the given property has a method with the given name

createProperty($property)

Creates a property of the given type

Units

UnitQuery(): BasicQuery

Creates a UnitQuery and returns its instance.

clearRegisteredUnits()

Clears the currently registered units

registerUnit(string $name, string $unit, string $group, string $basic = , ?callable $calculate_to = null, ?callable $calculate_from = null)

isUnitRegistered(string $property): bool

Returns true if the unit is registered otherwise false

getUnit(string $unit): string

Return the unit of the given unit name

getUnitGroup(string $unit): string

Returns the group of the given unit name

getUnitBasic(string $unit): string

Returns the basic unit name of the given unit name

calculateToBasic(string $unit, float $value): float

Calculates the given $value to the basic unit

calculateFromBasic(string $unit, float $value): float

Calculates the given $value from the basic unit