Index

ArrayProperty

MMO\core\attributes · 1 symbol · generated 30 Sep 2026

class

ArrayProperty

ArrayProperty.php:30

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://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 }

Index

getter readonly
name readonly
schema readonly
setter readonly
store readonly
getDefault()
getStore()
getTitle()
hasNoIndex()
isAliasGetter()
isAliasSetter()
isAliasStore()
isDirectGetter()
isDirectSetter()
isDirectStore()
isFrom($ref)
isHidden()A hidden property is still stored and loaded, and code reads it through its getter, but its value never leaves:
isReadonly()
isStorable()Tells if property will be stored in the repository: its store argument if given, else its @store tag, else whether it can be written (__construct)
isWriteonly()
__construct($name, $getter, $setter, $schema, $store)

Properties5

getter

readonly
readonly ?string $getter
Type
null | string

name

readonly
readonly string $name
Type
string

schema

readonly
readonly MMO\core\schemas\Schema $schema
Type
Schema

setter

readonly
readonly ?string $setter
Type
null | string

store

readonly
readonly string|bool $store
Type
string | bool

Methods16

getStore()

ArrayProperty.php:113
function getStore(): ?string
returnsnull | stringthe effective store accessor (falls back to the getter when $store was true), or null if not storable

getTitle()

ArrayProperty.php:168
function getTitle(): string
returnsstringthe property's display title, from its schema (@title), or '' if none

hasNoIndex()

ArrayProperty.php:163
function hasNoIndex(): bool
returnsbooltrue if the schema marks this property excluded from search indexing (@noindex), or it is isHidden

isAliasGetter()

ArrayProperty.php:135
function isAliasGetter(): bool
returnsbooltrue if the getter is a json-path alias (e.g. '/address/city'), not a direct property or method

isAliasSetter()

ArrayProperty.php:140
function isAliasSetter(): bool
returnsbooltrue if the setter is a json-path alias (e.g. '/address/city'), not a direct property or method

isDirectGetter()

ArrayProperty.php:119
function isDirectGetter(): bool
returnsbooltrue if the getter reads a plain object property directly (e.g. '$name'), not a method

isDirectSetter()

ArrayProperty.php:124
function isDirectSetter(): bool
returnsbooltrue if the setter writes a plain object property directly (e.g. '$name'), not a method

isFrom($ref)

ArrayProperty.php:78
function isFrom(ReflectionClass|string $ref): bool
$refReflectionClass | string
returnsbooltrue if this property's underlying getter/setter (property or method) is actually DECLARED on $ref itself, rather than inherited from a parent class

isHidden()

ArrayProperty.php:158

A hidden property is still stored and loaded, and code reads it through its getter, but its value never leaves:

function isHidden(): bool
See
tArrayProperties::toArray leaves it out even when it is asked for, an API query cannot filter or sort on it (Route::extractQuery), and it is not indexed for a text search (hasNoIndex).
returnsbooltrue if the property is isWriteonly, or its schema marks it 'hidden' (@hidden)
User::ArrayProperty('passhash')->isHidden(); // true: `@hidden`

isReadonly()

ArrayProperty.php:93
function isReadonly(): bool
returnsbooltrue if there is no setter (the value can't be written through array-property access)

isStorable()

ArrayProperty.php:108

Tells if property will be stored in the repository: its store argument if given, else its @store tag, else whether it can be written (__construct)

function isStorable(): bool
returnsbool
* @store false *\/ #[ArrayProperty()] protected array $cache; // isStorable() === false: set and read, never saved

isWriteonly()

ArrayProperty.php:98
function isWriteonly(): bool
returnsbooltrue if there is no getter (the value can't be read through array-property access)

__construct($name, $getter, $setter, $schema, $store)

ArrayProperty.php:49
function __construct( string $name = '', string|false|null $getter = null, string|false|null $setter = null, array|string $schema = [], string|bool|null $store = null )
$name = ''stringthe 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.
$getter = nullstring | false | nullthe 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.
$setter = nullstring | false | nullthe 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).
$schema = []array | stringhidden: true (what a @hidden tag gives) hides the property: isHidden
$store = nullstring | bool | nullthe 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.