MMOframework
Pourquoi l'IA Playground Bibliothèques Documentation Rechercher Agence
FR EN
Index

iCollection

MMO\core\interfaces · 1 symbole · générée le 27 Oct 2026

interface

iCollection

iCollection.php:15

A set of entities of one class, usually belonging to a repository. Collection implements it: this interface declares everything the framework relies on, so code typed against it works with any collection.

interface MMO\core\interfaces\iCollection extends Countable, JsonSerializable, MMO\core\interfaces\iIdentifiable
Espace de noms
MMO\core\interfaces
Implémente
Countable, JsonSerializable, iIdentifiable
It holds stored entities -- \MMO\core\entities\Entity, never an EmbeddedEntity.

Méthodes19

addEntity($entity)

abstractiCollection.php:31
abstract function addEntity(MMO\core\interfaces\iEntity $entity): MMO\core\interfaces\iEntity
$entityiEntity
retourneiEntity$entity, now in this collection

executeQuery($query, $opts)

abstractiCollection.php:48
abstract function executeQuery(MMO\core\entities\Query $query, array $opts = []): Generator
$queryQuery
$opts = []array
retourneGenerator

find($filter, $fields, $sort, $limit, $offset, $options)

abstractiCollection.php:50
abstract function find( MMO\core\interfaces\iFilter|array|string $filter, array $fields = [], array $sort = [], ?int $limit = null, ?int $offset = null, array $options = [] ): array
$filteriFilter | array | string
$fields = []array
$sort = []array
$limit = nullnull | int
$offset = nullnull | int
$options = []array
retournearray

findOne($filter, $fields, $sort, $offset, $options)

abstractiCollection.php:52
abstract function findOne( MMO\core\interfaces\iFilter|array|string $filter, array $fields = [], array $sort = [], ?int $offset = null, array $options = [] ): ?MMO\core\interfaces\iEntity
$filteriFilter | array | string
$fields = []array
$sort = []array
$offset = nullnull | int
$options = []array
retournenull | iEntity

getById($id, $find)

abstractiCollection.php:38
abstract function getById(string $id, bool $find = true): ?MMO\core\interfaces\iEntity
$idstring
$find = trueboolif it is not loaded yet, ask the repository
retournenull | iEntity

getEntities()

abstractiCollection.php:28
abstract function getEntities(): array
retournearraythe entities loaded so far

getEntityClass()

abstractiCollection.php:20
abstract function getEntityClass(): string
retournestringthe class of its entities

getOrCreateEntity($data, $local, $coerce)

abstractiCollection.php:44
abstract function getOrCreateEntity(array $data = [], bool $local = false, bool $coerce = true): MMO\core\interfaces\iEntity
$data = []array
$local = falsebool
$coerce = truebool
retourneiEntitythe entity matching $data on its @unique properties, or a new one

getSchema()

abstractiCollection.php:23
abstract function getSchema(): MMO\core\interfaces\iSchema
retourneiSchemathe schema of its entities

getSimilarEntity($data, $local, $coerce)

abstractiCollection.php:42
abstract function getSimilarEntity(array $data, bool $local = false, bool $coerce = true): ?MMO\core\interfaces\iEntity
$dataarray
$local = falsebool
$coerce = truebool
retournenull | iEntitythe entity matching $data on its @unique properties (or its id), if there is one

query($filter, $fields, $sort, $limit, $offset, $options)

abstractiCollection.php:47
abstract function query( MMO\core\interfaces\iFilter|array|string $filter = [], array $fields = [], array $sort = [], ?int $limit = null, ?int $offset = null, array $options = [] ): MMO\core\entities\Query
$filter = []iFilter | array | string
$fields = []array
$sort = []array
$limit = nullnull | int
$offset = nullnull | int
$options = []array
retourneQuery

removeEntity($entity)

abstractiCollection.php:33
abstract function removeEntity(MMO\core\interfaces\iEntity|string|int $entity): ?MMO\core\interfaces\iEntity
$entityiEntity | string | int
retournenull | iEntitythe entity removed, if it was there
Membres hérités (3)
MéthodesDéclaré parDescription
count()Countable
jsonSerialize()JsonSerializable
uid()iIdentifiableGet the unique identifier