Repository
MMO\core\entities · 1 symbol · generated 5 Oct 2026
Repository
Repository.php:20Collections container.
- Namespace
MMO\core\entities- Extends
- aRepository
Index
| createEntity($class, $data, $collection) | Same as aRepository::createEntity, auto-assigning the next id (generateId) if $data has none. | |
| dropCollection($collection) | NOTE: this used to just return $this->hasCollection($collection); -- reporting whether the collection exists, but never actually removing it from aRepository::$collections. | |
| executeQuery($query, $opts) | Find entities by content (delegates to the collection's own in-memory filtering -- see Collection::executeQuery). | |
| generateId($collection) | ||
| onCommit($commit) | There's nothing to actually persist here (entities already live in-memory in their collection) -- just logs a notice for each changed entity this repository is responsible for. | |
| uid() |
Methods6
createEntity($class, $data, $collection)
Repository.php:70Same as aRepository::createEntity, auto-assigning the next id (generateId) if $data has none.
| $class | string | |
| $data = [] | array | |
| $collection = null | null | iCollection | |
| returns | iEntity |
dropCollection($collection)
Repository.php:34NOTE: this used to just return $this->hasCollection($collection); -- reporting whether the collection exists, but never actually removing it from aRepository::$collections. Verified concretely:
- See
Collection::drop()(which calls this to do the actual removal) reported success, yet the collection remained fully registered and reachable viaaRepository::getCollectionafterward. Fixed to actually remove it (aRepository has no existing removal method to delegate to).
| $collection | iCollection | string | |
| returns | bool | false if $collection wasn't registered. |
executeQuery($query, $opts)
Repository.php:47Find entities by content (delegates to the collection's own in-memory filtering -- see Collection::executeQuery).
generateId($collection)
Repository.php:55| $collection | iCollection | |
| returns | int | one more than the highest existing (loaded) entity id, numerically -- or 1 if the collection is empty. |
onCommit($commit)
Repository.php:80There's nothing to actually persist here (entities already live in-memory in their collection) -- just logs a notice for each changed entity this repository is responsible for.
uid()
Repository.php:21| returns | string |
Inherited members (28)
| Properties | Declared by | Description | |
|---|---|---|---|
collections | aRepository |
| Methods | Declared by | Description | |
|---|---|---|---|
addCollection($name, $collection) | aRepository | Add collection | |
createCollection($name, $entityClass, $collectionId) | aRepository | Create and register a plain Collection for entities of $entityClass. | |
createLog($type, $origin, $collection, $data, $filters, $sorts, $limit, $offset) | aRepository | Build (but not dispatch) a LogQuery entity describing a data-mutating operation, stored in the repository's LogQuery collection (if one is registered). | |
debugName() | aRepository | ||
forceCommit($origin, $entities) | aRepository | ||
getCollection($name) | aRepository | ||
getCollectionByClass($entityClass, $allowChildClass) | aRepository | Find the collection whose entities are (an exact match, or optionally a subclass of) $entityClass. | |
getCollectionName($collection) | aRepository | ||
getCollections() | aRepository | ||
getDistinct($collection, $key) | aRepository | Every value one property takes across a collection, once each, in ascending order. | |
getEntities() | aRepository | ||
getIterator() | aRepository | \IteratorAggregate::getIterator -- iterates name => iCollection | |
hasCollection($collection) | aRepository | ||
hideLogData($collection, $data) | aRepository | What a repository logs is what it wrote (mmo.pdo's row, mmo.mongodb's document or its changes), hidden properties (ArrayProperty::isHidden) included, and a log is exported… | |
logDelete($origin, $collection, $data, $filters, $sorts, $limit, $offset) | aRepository | Log and dispatch a DELETE operation. | |
logInsert($origin, $collection, $data, $filters, $sorts, $limit, $offset) | aRepository | Log and dispatch an INSERT operation. | |
logStatus($origin, $collection, $data, $filters, $sorts, $limit, $offset) | aRepository | Log and dispatch a STATUS-change operation. | |
logUpdate($origin, $collection, $data, $filters, $sorts, $limit, $offset) | aRepository | Log and dispatch an UPDATE operation. | |
offsetExists($key) | aRepository | \ArrayAccess::offsetExists | |
offsetGet($key) | aRepository | \ArrayAccess::offsetGet | |
offsetSet($key, $value) | aRepository | \ArrayAccess::offsetSet -- equivalent to addCollection | |
offsetUnset($key) | aRepository | \ArrayAccess::offsetUnset | |
onFetch($event) | aRepository | Listener for Fetch: resolves a repository-uid/collection-id#id (or repository-uid/collection-id#id/nested/path for an embedded value) URL, what Ent… | |
searchText($query, $text) | aRepository | Full-text search. Not implemented at this level -- a concrete repository backed by a search-capable store should override this. | |
setCollections($cols) | aRepository | Register a batch of collections at once, e.g. | |
__construct($collections) | aRepository | ||
__wakeup() | aRepository | Register this repository's onCommit / onFetch as listeners on the global |