Index

Target

MMO\admin\entities · 1 symbol · generated 5 Oct 2026

class

Target

Target.php:44

One deployment target: a folder, on a Server, that a release is shipped to.

class MMO\admin\entities\Target extends MMO\core\entities\Entity
Namespace
MMO\admin\entities
Extends
Entity
See
iShell (local or ssh).
Targets are DECLARED (in `deploy.json`, [`Store`](https://mcp.mmoframework.fr/documentation/mmo.admin/php/helpers/Store.md#store)), never inferred from git branch names -- so adding a target does not require creating a branch first, and a target can be reached by any Every string property goes through [`resolve`](https://mcp.mmoframework.fr/documentation/mmo.admin/php/entities/Target.md#target-resolve), so `{name}` and any key of [`$vars`](https://mcp.mmoframework.fr/documentation/mmo.admin/php/entities/Target.md#target-vars) can be used as a placeholder in `folder`, `database`, `url`, `ref`, `reload`, ... **`vars` values are validated, not escaped.** Some of them land in `reload` and `postInstall`, which are executed as a shell command on the target -- frequently under `sudo`. Anything a shell would find interesting (`$`, backtick, `;`, `|`, `&`, quotes, newline) is rejected when the file is read ([`assertVars`](https://mcp.mmoframework.fr/documentation/mmo.admin/php/entities/Target.md#target-assertvars)), because a value that cannot contain a metacharacter cannot smuggle one into a command. `deploy.json` is trusted, reviewed code either way -- it is not, and must never become, user input. The on-target layout is deliberately immutable-release shaped: ``` {folder}/releases/{version}/ one extracted artifact, never modified in place {folder}/current -> releases/{version} the symlink the web server serves; swapping it is the deploy {folder}/shared/ the declared @see $shared paths, linked into every release -- only when there are some {folder}/deploy/ mmo.admin's own state: the journal, the lock, the install stamp {folder}/backups/ the database dumps -- only with a @see $database ``` No artifact is kept there: a release's tarball is uploaded into its staging folder, extracted and deleted ([`ShipTask`](https://mcp.mmoframework.fr/documentation/mmo.admin/php/tasks/ShipTask.md#shiptask)). The machine that built it has it, and a release folder is never edited. On a machine whose web server is the provider's ([`Server::$managed`](https://mcp.mmoframework.fr/documentation/mmo.admin/php/entities/Server.md#server-managed)), the document root is fixed in a control panel rather than in a vhost we can edit. [`$webRoot`](https://mcp.mmoframework.fr/documentation/mmo.admin/php/entities/Target.md#target-webroot) names that fixed path, and `install` turns it into a symlink onto `{folder}/current/{publicPath}` -- so the deploy is still the same one atomic swap, and nothing about a release changes because the host is shared.

Index

DEFAULT_WEB_ROOTwhat a managed server's target serves when it says nothing: a folder of its own folder.
NO_WEB_ROOTwhat a target writes as its webRoot to have none, managed server or not.
PROBES
PROBE_LOCALit runs on the DEPLOYING machine, against the public url only -- the only thing a webspace can prove.
PROBE_NONEit does not run: the release is considered good once current points at it.
PROBE_TARGETthe post-activation http probe runs on the target itself, against 127.0.0.1 and against the url.
SAFEwhat a target name, and any vars value, is allowed to contain.
databasethe database name on the target (null: this target has no database).
enabledfalse to keep the target declared but excluded from every TAG-based fan-out (Targets::select).
folderthe target's own folder, holding releases/, current, deploy/ -- and shared/, backups/ when it has some.
handleresolved lazily -- never part of the entity's data.
handleServer
healthExpecttext the answer to $healthPath must contain for the release to count as live (null: any 2xx).
healthFilea relative path that MUST exist in a shipped release for it to be considered valid.
healthOriginthe host header / origin the post-activation health check uses when probing the target from inside (null: derived from $url).
healthPaththe path the post-activation health check requests, on the host of $url (e.g.
healthTimeouthow long the post-activation health check keeps asking before giving up, in seconds (null: the value
keephow many releases to keep on the target (PruneTask).
namethe target's identifier, e.g.
probewhere the post-activation http probe runs from: one of PROBES (null: target, or local when the server is Server::$managed).
projectthe Project this target deploys (null: the single implicit project).
publicPaththe release-relative folder the web server serves -- the release's document root.
refthe git ref a release for this target is built from.
reloadcommand run on the target right after the symlink swap (e.g.
serverthe Server this target lives on.
sharedpaths (relative to a release) that must NOT be part of a release: they live in shared/ and are symlinked into every release, so they survive a deploy and a rollback untouched.
shella legacy/explicit iShell configuration path (local, #ssh), used when $server is not set.
tagsfree-form labels, used by --tags= selection (e.g.
urlthe public url, used by the post-activation health check.
varsextra {placeholders} available to every templated property of this target.
webRootthe path, fixed by the host, that must resolve to the live release's document root.
absolute($path, $what)
assertRequired()Refuse a target that does not say what it needs: nothing is inherited, so each one writes its own ref and folder -- and a folder that is relative has a server root to start from.
assertVars()Refuse a name or a vars value that a shell would find interesting.
assertWebRoot()Refuse a $webRoot that would make install do something irreversible or circular.
debugName()
getAddress()
getBackupFolder()
getCurrentLink()
getDatabase()
getDeclaredFolder()
getFolder()
getHealthExpect()
getHealthFile()
getHealthOrigin()
getHealthPath()
getHealthTimeout()
getHealthUrl()
getJournalFilename()
getKeep()
getLayoutFolders()The folders that must exist on the target before anything can be shipped to it: shared/ only for a target that declares shared paths, backups/ only for one with a database.
getLockFolder()
getName()
getProbe()
getProjectName()
getPublicFolder($release)
getPublicLink()
getPublicPath()
getRef()
getReleaseFolder($release)
getReleasesFolder()
getReload()
getServer()
getServerName()
getSharedFolder()
getSharedPaths()
getShell()The shell used to reach this target.
getShellPath()
getStateFolder()
getTags()
getUrl()
getWebRoot()
hasAnyTag($tags)
hasTag($tag)
isEnabled()
isLocal()
isManaged()
isWebRootInFolder()
resolve($text)Replace {name} and every $vars key in $text.
resolveTemplate($text)Resolve a template install writes on the target, or the command it runs: resolve, plus what only a whole target knows -- so that one vhost template serves every target, whatever each one dec…
setServer($server)
setShell($shell)Force the shell (used by tests, and by a controller that already holds a connected shell).

Constants7

DEFAULT_WEB_ROOT

what a managed server's target serves when it says nothing: a folder of its own folder. $webRoot

const DEFAULT_WEB_ROOT = '{folder}/web'

NO_WEB_ROOT

what a target writes as its webRoot to have none, managed server or not.

const NO_WEB_ROOT = 'none'

PROBES

const PROBES = ['target', 'local', 'none']

PROBE_LOCAL

it runs on the DEPLOYING machine, against the public url only -- the only thing a webspace can prove.

const PROBE_LOCAL = 'local'

PROBE_NONE

it does not run: the release is considered good once current points at it.

const PROBE_NONE = 'none'

PROBE_TARGET

the post-activation http probe runs on the target itself, against 127.0.0.1 and against the url.

const PROBE_TARGET = 'target'

SAFE

what a target name, and any vars value, is allowed to contain. assertVars

const SAFE = '/^[a-zA-Z0-9._\\/:@+-]*$/'

Properties24

database

the database name on the target (null: this target has no database).

#[MMO\core\attributes\ArrayProperty()] protected ?string $database = null
Type
null | string

enabled

false to keep the target declared but excluded from every TAG-based fan-out (Targets::select).

#[MMO\core\attributes\ArrayProperty()] protected bool $enabled = true
Type
bool

folder

the target's own folder, holding releases/, current, deploy/ -- and shared/, backups/ when it has some. Required. Absolute, or relative to its server's Server::$root -- acme on a server rooted at /var/www is /var/www/acme.

#[MMO\core\attributes\ArrayProperty()] protected ?string $folder = null
Type
null | string

handle

resolved lazily -- never part of the entity's data.

#[MMO\core\attributes\NoDump()] protected ?MMO\core\interfaces\iShell $handle = null
Type
null | iShell

handleServer

#[MMO\core\attributes\NoDump()] protected ?MMO\admin\entities\Server $handleServer = null
Type
null | Server

healthExpect

text the answer to $healthPath must contain for the release to count as live (null: any 2xx).

#[MMO\core\attributes\ArrayProperty()] protected ?string $healthExpect = null
Type
null | string
A status alone proves very little: a static `index.html` left in the public folder, an `.htaccess` the vhost ignores or the provider's parking page all answer 200 while the application never ran. Text only the application produces closes that; `{checksum}` -- the release's own `.release` stamp, which the application can read at its root and echo -- proves it is THIS release answering, not the one before. Also `{release}`, `{name}` and every [`$vars`](https://mcp.mmoframework.fr/documentation/mmo.admin/php/entities/Target.md#target-vars) key.

healthFile

a relative path that MUST exist in a shipped release for it to be considered valid.

#[MMO\core\attributes\ArrayProperty()] protected ?string $healthFile = 'www/index.php'
Type
null | string

healthOrigin

the host header / origin the post-activation health check uses when probing the target from inside (null: derived from $url). ActivateTask::checkHealth

#[MMO\core\attributes\ArrayProperty()] protected ?string $healthOrigin = null
Type
null | string

healthPath

the path the post-activation health check requests, on the host of $url (e.g. /health). Redirects are followed, and only a final 2xx counts. ActivateTask::checkHealth

#[MMO\core\attributes\ArrayProperty()] protected string $healthPath = '/'
Type
string

healthTimeout

how long the post-activation health check keeps asking before giving up, in seconds (null: the value

#[MMO\core\attributes\ArrayProperty()] protected ?int $healthTimeout = null
Type
null | int
It is per-target because the right answer is a property of the machine, not of the tool. On a host we control, `reload` restarts the interpreter and the new release answers at once, so 20s is generous. On a shared webspace there is nothing to restart: each php-fpm worker keeps its own realpath cache, so the swapped `current` is picked up as those entries expire (`realpath_cache_ttl`, 120s by default) and a 20-second deadline would roll back a release that was about to be perfectly fine.
See
ActivateTask was constructed with; 0 disables the http check entirely).

keep

how many releases to keep on the target (PruneTask).

#[MMO\core\attributes\ArrayProperty()] protected int $keep = 5
Type
int

name

the target's identifier, e.g. 'demo'.

#[MMO\core\attributes\ArrayProperty()] protected string $name = ''
Type
string

probe

where the post-activation http probe runs from: one of PROBES (null: target, or local when the server is Server::$managed).

#[MMO\core\attributes\ArrayProperty()] protected ?string $probe = null
Type
null | string

project

the Project this target deploys (null: the single implicit project).

#[MMO\core\attributes\ArrayProperty()] protected ?string $project = null
Type
null | string

publicPath

the release-relative folder the web server serves -- the release's document root.

#[MMO\core\attributes\ArrayProperty()] protected string $publicPath = 'www'
Type
string
`www` for a project laid out like the framework's own template; `''` for one whose `.htaccess` sits at the release root and rewrites inwards (which is how `mmo.client`'s demo is built: the root `.htaccess` sets `MMO_MODE_REWRITE demo/www`, so the ROOT is what must be served).

ref

the git ref a release for this target is built from. Required: nothing picks one for a target.

#[MMO\core\attributes\ArrayProperty()] protected ?string $ref = null
Type
null | string

reload

command run on the target right after the symlink swap (e.g. a php-fpm reload + opcache reset).

#[MMO\core\attributes\ArrayProperty()] protected ?string $reload = null
Type
null | string

server

the Server this target lives on.

#[MMO\core\attributes\ArrayProperty()] protected ?string $server = null
Type
null | string

shared

paths (relative to a release) that must NOT be part of a release: they live in shared/ and are symlinked into every release, so they survive a deploy and a rollback untouched.

#[MMO\core\attributes\ArrayProperty(schema: '[string]')] protected array $shared = []
Type
array

shell

a legacy/explicit iShell configuration path (local, #ssh), used when $server is not set.

#[MMO\core\attributes\ArrayProperty()] protected ?string $shell = null
Type
null | string
Prefer declaring a server: 27 targets all pointing at `#ssh` look independent while sharing one machine.

tags

free-form labels, used by --tags= selection (e.g. 'prod', 'staging').

#[MMO\core\attributes\ArrayProperty(schema: '[string]')] protected array $tags = []
Type
array

url

the public url, used by the post-activation health check.

#[MMO\core\attributes\ArrayProperty()] protected ?string $url = null
Type
null | string

vars

extra {placeholders} available to every templated property of this target. assertVars NOTE the explicit object schema is required: a plain #[ArrayProperty()] on an array property coerces to a LIST, so a map like {"domain": "x.com"} fails to coerce and is dropped -- silently, into

#[MMO\core\attributes\ArrayProperty(schema: ['type' => 'object', 'additionalProperties' => true])] protected array $vars = []
Type
array
See
aEntity::getErrors, which nothing reads. Store::assertRow now reads it.

webRoot

the path, fixed by the host, that must resolve to the live release's document root. Absolute, or relative to the server's Server::$root; {folder} stands for the target's folder.

#[MMO\core\attributes\ArrayProperty()] protected ?string $webRoot = null
Type
null | string
This is the answer to "the provider decides what is served and I cannot edit a vhost". `install` makes that path a symlink onto `{folder}/current/{publicPath}` (moving whatever was there aside, never deleting it), after which every deploy and every rollback is the ordinary `current` swap and this path never moves again. null: [`DEFAULT_WEB_ROOT`](https://mcp.mmoframework.fr/documentation/mmo.admin/php/entities/Target.md#target-default-web-root) on a managed server -- the project's one folder holds what its domain serves -- and none elsewhere, where the vhost points at `current` itself. [`NO_WEB_ROOT`](https://mcp.mmoframework.fr/documentation/mmo.admin/php/entities/Target.md#target-no-web-root): none on a managed server either, when its panel can point the domain straight at `{folder}/current/{publicPath}`.

Methods51

absolute($path, $what)

Target.php:360
protected function absolute(string $path, string $what): string
$pathstring
$whatstringthe key it is the value of, for the error.
returnsstring$path, when absolute; under the server's root otherwise.
throws

assertRequired()

Target.php:265

Refuse a target that does not say what it needs: nothing is inherited, so each one writes its own ref and folder -- and a folder that is relative has a server root to start from.

function assertRequired(): void
returnsvoid
throws

assertVars()

Target.php:231

Refuse a name or a vars value that a shell would find interesting.

function assertVars(): voidCalled by the store after loading, NOT by the constructor: an entity built from an already-validated store record (or by a test) should not pay for it twice, and the error belongs to the file, with the file's name in it.
returnsvoid
throws

assertWebRoot()

Target.php:294

Refuse a $webRoot that would make install do something irreversible or circular.

protected function assertWebRoot(): void`install` replaces that path with a symlink, so it is the one path in the declaration pointed at something the tool did not create -- very often the provider's `htdocs`, with a live site in it. Two mistakes are worth catching before a connection is even opened: - a relative path with no server root to start from, which `mv` and `ln` would resolve against whatever the ssh session's home happens to be rather than against anything declared here ([`absolute`](https://mcp.mmoframework.fr/documentation/mmo.admin/php/entities/Target.md#target-absolute)); - [`$folder`](https://mcp.mmoframework.fr/documentation/mmo.admin/php/entities/Target.md#target-folder) itself, or a path inside what the deployment made of it -- `releases/`, `shared/`, `current` -- which would have `install` move the deployment's own tree aside and link it to itself; - a path [`$folder`](https://mcp.mmoframework.fr/documentation/mmo.admin/php/entities/Target.md#target-folder) is inside: `install` would move the whole deployment aside, and whatever it put back would serve every release, and the journal beside them. A web root BESIDE the layout, in the target's folder, is fine, and the tidy way on a webspace: everything of one project in one folder, `{folder}/web` pointed at by the panel and linked onto `current/`. What is served is only what that link leads to.
returnsvoid
throws

getAddress()

Target.php:494
function getAddress(): string
returnsstringhow a human should read where this target lives.

getDeclaredFolder()

Target.php:352
function getDeclaredFolder(): ?string
returnsnull | stringthe folder as deploy.json writes it, placeholders resolved -- relative or not.

getFolder()

Target.php:347
function getFolder(): string
returnsstringthe target's folder, absolute: as written, or under its server's root.
throwswhen it is relative and its server has no root to start from.

getHealthOrigin()

Target.php:437
function getHealthOrigin(): ?string
returnsnull | stringthe Host header the internal health probe should send.

getLayoutFolders()

Target.php:478

The folders that must exist on the target before anything can be shipped to it: shared/ only for a target that declares shared paths, backups/ only for one with a database.

function getLayoutFolders(): array
returnsarray

getProbe()

Target.php:418
function getProbe(): string
returnsstringwhere the post-activation http probe runs from, one of PROBES. A managed webspace defaults to local because its loopback is not this site (Server::$managed).

getPublicFolder($release)

Target.php:462
function getPublicFolder(string $release): string
$releasestring
returnsstringone release's own document root.

getPublicPath()

Target.php:380
function getPublicPath(): string
returnsstringthe release-relative document root, with no leading or trailing slash ('' means the release root).

getSharedPaths()

Target.php:444
function getSharedPaths(): array
returnsarraythe release-relative paths kept in shared/, placeholders resolved.

getShell()

Target.php:513

The shell used to reach this target.

function getShell(): MMO\core\interfaces\iShell
returnsiShell
throwsif nothing usable is configured.

getStateFolder()

Target.php:468
function getStateFolder(): string
returnsstringthe folder of mmo.admin's own state on the target: nothing of the site, nothing served.

isLocal()

Target.php:503
function isLocal(): bool
returnsboolwhether this target is on THIS machine: its server's shell, or its own, is local -- read the way getShell reads it. A trial of the pipeline or a test, never a server whose web server is ours.

isWebRootInFolder()

Target.php:315
function isWebRootInFolder(): bool
returnsboolwhether $webRoot is in the target's own folder, beside releases/, shared/ and current.

resolve($text)

Target.php:325

Replace {name} and every $vars key in $text.

function resolve(?string $text): ?string
$textnull | string
returnsnull | stringis string ? string : null) $text with its placeholders replaced (null in, null out).

resolveTemplate($text)

Target.php:400

Resolve a template install writes on the target, or the command it runs: resolve, plus what only a whole target knows -- so that one vhost template serves every target, whatever each one declares.

function resolveTemplate(?string $text): ?string- `{folder}`: the target's folder, absolute; - `{publicPath}`: the release's served folder (`www`), `{public}` the path the web server serves (`{folder}/current/{publicPath}`); - `{host}`: the host of its url.
$textnull | string
returnsnull | stringis string ? string : null)

setShell($shell)

Target.php:530

Force the shell (used by tests, and by a controller that already holds a connected shell).

function setShell(MMO\core\interfaces\iShell $shell): void
$shelliShell
returnsvoid
Inherited members (110)
ConstantsDeclared byDescription
FLAG_CHANGEDiEntity
FLAG_CREATEDiEntity
FLAG_IGNORE_CHANGEiEntity
FLAG_IGNORE_ENTITYiEntity
FLAG_OPACIFYiEntity
FLAG_REMOVEDiEntity
PropertiesDeclared byDescription
ArrayPropertiesaEntity
changesaEntity
collectionEntity
ctimeEntity
errorsaEntity
flagsaEntity
idEntityidentifier in collection
labelEntityshort name
linksaEntity
mtimeEntity
SearchPropertiesaEntity
statusaEntity
titleEntitylong name
MethodsDeclared byDescription
addFlags($flags)aEntity
addLink($link)aEntityAppend a link.
archive()aEntityThis function is called to 'delete' the entity.
ArrayProperties()aEntityBuild (once per class, then cached in the static $ArrayProperties array) the list of every #[ArrayProperty] declared on this class, its parent classes, and the traits they use -- by reflection…
ArrayProperty($name)aEntity
CheckData($data, $errors)aEntityCheck data before it touches any entity: would an entity made from $data be valid?
clearChanges()aEntityReset change tracking: clears iEntity::FLAG_CHANGED and forgets every recorded change.
compareTo($value)aEntityCompare value
conversionError($key, $e)aEntityThe error recorded for a value that could not be set at all (usually: it could not be converted to its property's type), in the same form as a validation error.
Copy($entity, $properties)EntityBuild a new entity from $entity's own stored data (a duplicate, minus its id -- so saving it creates a genuinely new record -- in the same collection).
get($path, $default)aEntityRead a (possibly nested) value by json-path, e.g.
getArrayProperty($key, $isRef, $store)aEntityRead a single array property's current value, through its getter (a direct property, a path alias, or a method).
getChanges($asArray, $store)aEntity
getCollection()Entity
getCtime()Entity
getErrors()aEntity
getFlags()aEntity
getId()Entity
getLabel()Entity
getLinks()aEntity
getLinksByRel($rels, $all)aEntityGet a list of Reference that have a specific relationship.
getMetadata()aEntity
getMtime()Entity
getRepository()Entity
getStatus()aEntity
getTitle()Entity
getView()aEntity
hasChanged($keys)aEntity
hasFlags($flags, $strict)aEntity
hasStatusChanged()aEntity
HiddenPath($path)aEntityThe hidden property (ArrayProperty::isHidden) a json-path goes through, known from the declared types alone: of this class, or of a class a property on the way may hold -- every class of its t…
ignore()EntityIgnore everything about this entity: discard its pending changes and flag it so it's skipped by future commits (aRepository::onCommit).
ignoreChanges($value)aEntityTemporarily suppress markChanged (used e.g.
isActive()aEntity
isArchive()aEntity
isArrayPropertySet($key, $store)EntitySame as aEntity::isArrayPropertySet, but 'ctime'/'mtime' are never reported as "set" (they're always present, so listing them adds no information), and neither is 'id' once the entity is alrea…
isChanged()aEntity
isCreated()aEntity
isDraft()aEntity
isEmpty()aEntity
isFinal()aEntity
isHiddenPath($path)aEntity
isIgnored()Entity
isOpacified()aEntity
isPending()aEntity
isRemoved()aEntity
isSimilar($value)Entity
isUnique()aEntityTells if an entity has enough information to be unique (at least one unique group has no null)
isValid()aEntity
isValidated()aEntity
ListClassReferences($onlyStorable)aEntityGet a list of all the classes and their properties that are using references to this class.
loadArray($data, $coerceOptions, $fromStore)EntitySame as aEntity::loadArray, but 'ctime'/'mtime' are never taken from $data: they belong to the server (set when the entity is created, bumped by markChanged), and a client sending back th…
loadFromStore($data)EntityRestore from stored data, setting 'ctime'/'mtime' directly (bypassing their normal setters -- see setCtime/setMtime, which are read-only via #[ArrayProperty]).
localName()Entity
loopReferences()EntityYield all the entities in the repository that have a reference on this one.
markChanged($keys)EntitySame as aEntity::markChanged, also bumping $mtime to now -- unless the change itself was to 'ctime'/'mtime' (avoiding infinite recursion via setMtime's own markChanged call).
mutate($type, $path, $value, $oldValue)aEntity\MMO\core\interfaces\iMutationObserver::mutate -- besides the normal tArrayProperties::mutate behavior, walks up $path to find the nearest enclosing aEntity (the mutation may have happened dee…
offsetExists($key)aEntity\ArrayAccess::offsetExists -- tells whether $key is a *declared* #[ArrayProperty], not whether it currently holds a non-default value (use isArrayPropertySet for that).
offsetGet($key)aEntity\ArrayAccess::offsetGet
offsetSet($key, $value)aEntity\ArrayAccess::offsetSet
offsetUnset($key)aEntity\ArrayAccess::offsetUnset -- equivalent to setting the property to null (its coerced value depends on the property's schema: e.g.
opacify($value)aEntityHide this entity's properties from toArray output (typically used to redact an entity the current viewer isn't allowed to see the details of, while still letting it be referenced by uid/metadata).
push($path, $value)aEntityAppend a value to a (possibly nested) list property by json-path.
reload()EntityReload entity from its repository
removeFlags($flags)aEntity
removeLink($link)aEntityRemove a link (by identity).
removePermanently($force)EntityRemove entity from database
replaceBy($replace, $mergeData)EntityReplace this entity by another one, trying to change all references to this entity to the new one.
Schema()aEntityThe JSON-Schema describing every #[ArrayProperty] of this class (built once and cached by ArrayProperties).
SearchProperty($name)aEntity
set($path, $value)aEntityWrite a (possibly nested) value by json-path, creating intermediate structure as needed.
setArrayProperty($key, $value, $coerceOptions, $ignoreReadonly)aEntitySame as tArrayProperties::setArrayProperty, plus: any coercion/validation failure is caught and recorded in getErrors (making the entity isValid()-false) instead of propagating as an…
setArrayPropertyOffset($key, $offset, $value, $coerceOptions)aEntitySame as tArrayProperties::setArrayPropertyOffset, plus: when pushing (offset === null) a new entity onto a list property, if an existing item is isSimilar to the new value, that item's of…
setCollection($collection, $removeFromCollection)EntityMove this entity to (or out of, if null) a collection.
setCtime($date, $force)EntitySet creation time
setId($id)EntitySet the id, re-registering this entity in its $collection under the new id (Collection's entities are keyed by id).
setLinks($links)aEntityReplace every link with $links.
setMtime($date, $force)EntitySet modification time
setStatus($status)aEntity
store()aEntityExport all array properties with store set to true.
test($filter)aEntity
toArray($fields, $flatten, $recursive)aEntitySame as tArrayProperties::toArray, except an isOpacified entity always exports only its 'uid' and 'metadata' (its other properties are hidden from output).
toLink($attributes)aEntity
traitMutate($type, $path, $value, $oldValue)aEntity\MMO\core\interfaces\iMutationObserver::mutate -- reacts to a mutation that happened deep inside one of this object's array properties (e.g.
traitSetArrayProperty($key, $value, $coerceOptions, $fromStore)aEntitySet array property
traitSetArrayPropertyOffset($key, $offset, $value, $coerceOptions)aEntitySet/push a value into an array property
traitToArray($fields, $flatten, $recursive)aEntityExport fields to an array.
uid()Entity
validate($errors)aEntityValidate this entity: its current values against its own tArrayProperties::Schema, plus every value that could not even be set -- one that could not be converted to its property's type never r…
View()aEntity
__construct($data, $collection)Entity