trait Getter (View source)

This trait is utilized for reading data from inaccessible (protected or private) or non-existing properties.

Methods:

  • __get(string $name): mixed: Retrieves the value of a property if it exists, or returns null if the property is inaccessible or non-existent.

Fields:

  • $property: Stores properties for dynamic property access.

Traits

This trait provides a private array property intended for use with magic setter and getter methods.

Methods

mixed
__get(string $name)

Magic method to get the value of inaccessible or non-existing properties.

Details

mixed __get(string $name)

Magic method to get the value of inaccessible or non-existing properties.

Parameters

string $name

Property name

Return Value

mixed

The property value