Declares a single named property of a tArrayProperties-using class: how to read it (getter), write it (setter), persist it (store), and its JSON-Schema. Placed directly on a property (name/getter/setter default from the property itself), or on the class itself for a "virtual" property backed entirely by methods (e.g. #[ArrayProperty(name: 'uid', getter: 'uid')]).
#[Attribute(73)]
class MMO\core\attributes\ArrayProperty
Namespace
MMO\core\attributes
A hidden property (`@hidden` in its docblock, or no getter) is kept, stored and loaded like any other, and code
reads it through its getter (`$user['passhash']`), but it is never exported ([`isHidden`](https://mcp.mmoframework.fr/documentation/mmo.core/php/attributes/ArrayProperty.md#arrayproperty-ishidden)): made for a secret,
such as a password's hash.
class Person {
use tArrayProperties;
#[ArrayProperty] protected string $name = ''; // getter/setter default to '$name'
#[ArrayProperty(setter: false)] protected int $id; // read-only
* @hidden *\/
#[ArrayProperty(setter: false, store: true)] protected string $passhash; // stored, never exported
}
the property's name. Leave it out on a property: the framework passes the property's own name (tArrayProperties), which is why #[ArrayProperty()] is the normal way to write it. Required on a class, where the attribute declares a virtual property.
the method to read the property: a method's name or a property's name (start with $) of the instance. If null or false, the value cannot be read (write only). WARNING: the method MUST return a reference.
the method to write the property: a method's name or a property's name (start with $) of the instance. If null or false, the value cannot be written (read only).
the method to store the property: a method's name or a property's name (start with $) of the instance. If false, the value cannot be stored. If true, it uses the getter. If null, the schema's store decides (a @store or @store false tag), else a property is stored when it can be written.