tArray
MMO\core\classes · 1 symbol · generated 30 Sep 2026
tArray
tArray.php:16Trait implementing iArray: gives a class array-like storage (ArrayAccess, Countable, IteratorAggregate, JsonSerializable) backed by a single protected $content array.
- Namespace
MMO\core\classes
Index
| content | ||
| clear() | Empty the underlying content, keeping the object itself. | |
| count() | \Countable::count | |
| getIterator() | \IteratorAggregate::getIterator | |
| isEmpty() | ||
| jsonSerialize() | \JsonSerializable::jsonSerialize -- the raw content is returned as-is (not recursively converted), so json_encode() relies on any nested iArray values being JsonSerializable themselves. | |
| keys() | ||
| loadArray($data) | Load every entry of a plain array into the content, through offsetSet (so any offsetSet() override defined by the class using this trait, e.g. | |
| offsetExists($key) | \ArrayAccess::offsetExists | |
| offsetGet($key) | \ArrayAccess::offsetGet | |
| offsetSet($key, $value) | \ArrayAccess::offsetSet -- a null $key appends ($bag[] = $value), like a plain PHP array. | |
| offsetUnset($key) | \ArrayAccess::offsetUnset -- on a list (sequential integer keys, as produced by $bag[] = ...), the element is spliced out (closing the gap and reindexing), matching \unset() semantics on a plain … | |
| toArray() | Convert the content to a plain array, recursively converting any nested iArray value (e.g. |
Properties1
content
Methods12
clear()
tArray.php:25Empty the underlying content, keeping the object itself.
| returns |
count()
tArray.php:90\Countable::count
| returns | int |
getIterator()
tArray.php:97\IteratorAggregate::getIterator
| returns | Traversable |
isEmpty()
tArray.php:33| returns | true if the underlying content has no elements |
jsonSerialize()
tArray.php:43\JsonSerializable::jsonSerialize -- the raw content is returned as-is (not recursively converted), so json_encode() relies on any nested iArray values being JsonSerializable themselves.
| returns | mixed |
keys()
tArray.php:82| returns | array | the list of keys currently set |
loadArray($data)
tArray.php:71Load every entry of a plain array into the content, through offsetSet (so any offsetSet() override defined by the class using this trait, e.g. for validation or type coercion, is honored for every entry).
offsetExists($key)
tArray.php:130\ArrayAccess::offsetExists
offsetGet($key)
tArray.php:115\ArrayAccess::offsetGet
offsetSet($key, $value)
tArray.php:122\ArrayAccess::offsetSet -- a null $key appends ($bag[] = $value), like a plain PHP array.
offsetUnset($key)
tArray.php:107\ArrayAccess::offsetUnset -- on a list (sequential integer keys, as produced by $bag[] = ...), the element is spliced out (closing the gap and reindexing), matching \unset() semantics on a plain PHP list; on an associative array, the key is simply removed.
toArray()
tArray.php:56Convert the content to a plain array, recursively converting any nested iArray value (e.g. another object using this same trait) into its own plain-array form as well.
| returns | array |