Property facade: Difference between revisions

From Sunhill Framework Documentation
Page created
 
Restructured
 
Line 2: Line 2:
The '''Property facade''' is a laravel facade that provides methods to deal with the management of properties.  
The '''Property facade''' is a laravel facade that provides methods to deal with the management of properties.  


== clearRegisteredProperties() ==
== Properties ==
=== PropertyQuery(): BasicQuery ===
Creates a property query and returns its instance.
 
=== clearRegisteredProperties() ===
Clears all registered properties
Clears all registered properties


== registerProperty(string $property, ?string $alias = null) ==
=== registerProperty(string $property, ?string $alias = null) ===
Registered a new property to the manager
Registered a new property to the manager
      
      
== isPropertyRegistered($property): bool ==
=== isPropertyRegistered($property): bool ===
Returns true, when the given name or class was already registered
Returns true, when the given name or class was already registered


== getNamespaceOfProperty($property) ==
=== getNamespaceOfProperty($property) ===
Returns the full classname with namespace of the given property
Returns the full classname with namespace of the given property
      
      
== getNameOfProperty($property) ==
=== getNameOfProperty($property) ===
Returns the name of the given property
Returns the name of the given property
      
      
== propertyHasMethod($property, $method) ==
=== propertyHasMethod($property, $method) ===
Testss if the given property has a method with the given name
Testss if the given property has a method with the given name
      
      
== createProperty($property) ==
=== createProperty($property) ===
Creates a property of the given type
Creates a property of the given type


== clearRegisteredUnits() ==
== Units ==
 
=== UnitQuery(): BasicQuery ===
Creates a UnitQuery and returns its instance.
 
=== clearRegisteredUnits() ===
Clears the currently registered units
Clears the currently registered units
      
      
== registerUnit(string $name, string $unit, string $group, string $basic = '', ?callable $calculate_to = null, ?callable $calculate_from = null) ==
=== registerUnit(string $name, string $unit, string $group, string $basic = '', ?callable $calculate_to = null, ?callable $calculate_from = null) ===
      
      
== isUnitRegistered(string $property): bool ==
=== isUnitRegistered(string $property): bool ===
Returns true if the unit is registered otherwise false
Returns true if the unit is registered otherwise false
      
      
== getUnit(string $unit): string ==
=== getUnit(string $unit): string ===
Return the unit of the given unit name
Return the unit of the given unit name
      
      
== getUnitGroup(string $unit): string ==
=== getUnitGroup(string $unit): string ===
Returns the group of the given unit name
Returns the group of the given unit name
      
      
== getUnitBasic(string $unit): string ==
=== getUnitBasic(string $unit): string ===
Returns the basic unit name of the given unit name
Returns the basic unit name of the given unit name
      
      
== calculateToBasic(string $unit, float $value): float ==
=== calculateToBasic(string $unit, float $value): float ===
Calculates the given $value to the basic unit
Calculates the given $value to the basic unit
      
      
== calculateFromBasic(string $unit, float $value): float ==
=== calculateFromBasic(string $unit, float $value): float ===
Calculates the given $value from the basic unit
Calculates the given $value from the basic unit
   
   
[[Category:Properties]]
[[Category:Properties]]
[[Category:Facade]]
[[Category:Facade]]

Latest revision as of 18:17, 3 October 2024

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