The following declares a virtual property named "fullName" on the person class:
/** @property string $fullName */
class Person {
// ...shortened for brevity, will use __set() and __get()
}
$c= new XPClass(Person::class);
$fields= $c->getFields(); // Includes fullName virtual field
$exists= $c->hasField('fullName'); // true
$field= $c->getField('fullName'); // lang.reflect.Field
$value= $field->get(new Person()); // Invokes Person::__get('fullName')
See xp-framework/rfc#340. Prerequisite for xp-framework/compiler#124 and xp-framework/reflection#14
The following declares a virtual property named "fullName" on the person class:
See xp-framework/rfc#340. Prerequisite for xp-framework/compiler#124 and xp-framework/reflection#14