MMO\core\objects
MMO\core\objects · 18 symbols · generated 5 Oct 2026
compare
objects.php:447- Namespace
MMO\core\objects
Call graph
connect
objects.php:372- Namespace
MMO\core\objects
| $obj | object | string | the instance (or classname, for static listeners) to connect |
| $classFilter = null | null | string | only connect #[Listen] attributes targeting this class or a descendant of it |
| returns | void | |
| throws |
Call graph
Used by (16)
- Configuration::__construct
- aMessage::ConnectListeners
- tEvent::ConnectListeners
- tException::ConnectListeners
- LogQuery::ConnectListeners
- MailLog::ConnectListeners
- Query::ConnectListeners
- DocumentInit::ConnectListeners
- DocumentRender::ConnectListeners
- Event::ConnectListeners
- Log::ConnectListeners
- eDeprecated::ConnectListeners
- eInvalid::ConnectListeners
- eLogic::ConnectListeners
- eRuntime::ConnectListeners
- unserialize
disconnect
objects.php:407Undo a previous connect(): remove an object's (or class's) #[Listen]-declared methods from the events they were registered on.
- Namespace
MMO\core\objects
| $obj | object | string | the instance (or classname) to disconnect |
| $classFilter = null | null | string | only disconnect #[Listen] attributes targeting this class or a descendant of it |
| returns | void | |
| throws |
Call graph
Used by (14)
- aMessage::DisconnectListeners
- tEvent::DisconnectListeners
- tException::DisconnectListeners
- LogQuery::DisconnectListeners
- MailLog::DisconnectListeners
- Query::DisconnectListeners
- DocumentInit::DisconnectListeners
- DocumentRender::DisconnectListeners
- Event::DisconnectListeners
- Log::DisconnectListeners
- eDeprecated::DisconnectListeners
- eInvalid::DisconnectListeners
- eLogic::DisconnectListeners
- eRuntime::DisconnectListeners
enumFrom
objects.php:51Same as tryEnumFrom(), but throws instead of returning null when nothing matches.
- Namespace
MMO\core\objects
| $enum | string | the enum's classname |
| $value | string | int | the backing value or the case name |
| returns | UnitEnum | |
| throws | if no case matches $value |
Call graph
Uses (1)
greaterThan
objects.php:525Tells if $a orders after $b (per compare()'s ordering result).
- Namespace
MMO\core\objects
| $a | mixed | |
| $b | mixed | |
| $orEqual = false | bool | if true, also return true when $a and $b are equal (strict or loose) |
| returns | bool |
Call graph
Uses (1)
Used by (1)
isEqual
objects.php:492Tells if two values are STRICTLY equal, per compare() (i.e. compare() returned true, not just 0).
- Namespace
MMO\core\objects
Call graph
Uses (1)
isSame
objects.php:509Tells if two values are equal, in either sense compare() can report equality (strict true, or the ordering-comparison tie value 0). This is the equality check used throughout the framework for detecting whether a property's value actually changed (tArrayProperties), for entity/array property matching, and for the Filter::Equal/Filter::Diff query filters.
- Namespace
MMO\core\objects
Call graph
isSerialized
objects.php:90Tells if an array (recursively) contains at least one serialized-object marker (a ['$' => ...] entry, as produced by serialize()), meaning it needs unserialize() to be turned back into real objects.
- Namespace
MMO\core\objects
Call graph
Uses (1)
Used by (2)
lesserThan
objects.php:538Tells if $a orders before $b (per compare()'s ordering result).
- Namespace
MMO\core\objects
| $a | mixed | |
| $b | mixed | |
| $orEqual = false | bool | if true, also return true when $a and $b are equal (strict or loose) |
| returns | bool |
Call graph
Uses (1)
Used by (1)
serialize
objects.php:118Serialize an object (or an array possibly containing objects) into a plain, JSON-safe nested array that
- Namespace
MMO\core\objects- See
unserialize()can later turn back into live objects. An object is serialized as['$' => <factory>, ...properties], where <factory> is either a classname (its properties are then reflected back in on unserialize --serializeProperties/unserializeProperties), or a callable (a plain function reference for special cases like enums/DateTime -- its args are the array's remaining numeric entries). When the same object is encountered a second time within one call (a cycle, or simply shared by reference), it is serialized as a back-reference['$' => '#path/to/the/first/occurrence']instead of being duplicated/recursing infinitely. - Use the attribute \MMO\core\attributes\Serialize on a property to alter how (or whether) it is serialized. - Implement \MMO\core\interfaces\iSerializable on a class to take full control of its serialization.
| $value | object | array | |
| $path = '' | string | the current path in the overall structure being serialized (used to build back-references) |
| $hashes = null | null | WeakMap | internal: tracks objects already serialized in this call, to detect cycles/sharing |
| returns | array |
serializeProperties
objects.php:159Reflect over an object's properties and serialize them into a plain array (the default serialization strategy used by serialize() for objects that don't implement iSerializable themselves).
- Namespace
MMO\core\objects
| $obj | object | the object to serialize |
| $serializer | callable | the function to serialize inner objects|arrays: function(array|object $value, string $path): mixed |
| $path = '' | string | the current path of the serialization |
| returns | array | ['$' => get_class($obj), ...serializedProperties] |
Call graph
Used by (2)
tryEnumFrom
objects.php:30Get an enum case from its backing value (for a BackedEnum) or its case name (for any enum), without throwing.
- Namespace
MMO\core\objects
| $enum | string | the enum's classname |
| $value | string | int | the backing value (e.g. 1, 'active') or the case name (e.g. 'ACTIVE') |
| returns | null | UnitEnum | null if no case matches |
Call graph
uniqueClassID
objects.php:69Get a small, stable, per-class-sequential id for an object (1, 2, 3, ... within each class), for the duration of the current request only. The same object always returns the same id (tracked via a WeakMap, so it doesn't keep the object alive). Mainly used by the debug dumper (\MMO\dump()/idump()) to give the developer a short, human-readable label to tell apart several instances of the same class in a dump.
- Namespace
MMO\core\objects
unserialize
objects.php:204Turn data produced by serialize() back into live objects/arrays.
- Namespace
MMO\core\objects
| $data | array | |
| $path = '' | string | the current path in the overall structure (used to resolve/build '#' back-references) |
| $instances = [] | Container | array | |
| returns | mixed | |
| throws |
unserializeDateTime
objects.php:341Factory used by unserialize() to restore a DateTime serialized by serialize().
- Namespace
MMO\core\objects
unserializeDateTimeImmutable
objects.php:351Same as unserializeDateTime(), but returns a DateTimeImmutable.
- Namespace
MMO\core\objects
| $RFCDate | string | a date formatted per \DateTimeInterface::RFC3339_EXTENDED |
| returns | DateTimeImmutable |
unserializeEnum
objects.php:328Factory used by unserialize() to restore an enum case serialized by serialize() (['$' => ...unserializeEnum, $class, $case->name]).
- Namespace
MMO\core\objects
| $class | string | the enum's classname |
| $name | string | the case's name (NOT its backing value -- tryEnumFrom for that) |
| returns | UnitEnum |
unserializeProperties
objects.php:275Restore an object's properties from serialized data, via reflection (bypassing setters).
- Namespace
MMO\core\objects
| $obj | object | the (already-created, but not yet populated) object to restore properties on |
| $data | array | the serialized properties (without the '$' key) |
| $path = '' | string | the current path in the overall structure (passed down to nested unserialize() calls) |
| $instances = [] | Container | array | |
| $ref = null | null | ReflectionClass | reflection of $obj's class. Computed automatically if not given. |
| returns | object | $obj, for convenience |
| throws |