Protected
Optional
$allowlistIf this is defined, then it lists the only properties that will be accepted from incoming JSON. Any other properties will be ignored.
If you use an allowlist, you don't need to use protectedData, since you can simply leave those entries out of allowlistData.
Protected
Optional
$allowlistIf this is defined, then it lists the only tags that will be accepted from incoming JSON. Any other tags will be ignored.
Protected
$clientThe names of methods allowed to be called by the frontend with serverCall.
Protected
$dataThe data proxy object.
Protected
$dataThe data proxy handler.
Protected
$dataThe actual data store.
Protected
$isASleepingWhether this instance is a sleeping reference.
The instance of Nymph to use for queries.
Protected
$privateProperties that will not be serialized into JSON with toJSON(). This can be considered a denylist, because these properties will not be set with incoming JSON.
Clients CAN still determine what is in these properties, unless they are also listed in searchRestrictedData.
Protected
$protectedProperties that can only be modified by server side code. They will still be visible on the frontend, unlike $privateData, but any changes to them that come from the frontend will be ignored.
In addition to what's listed here, all of the access control properties will be included when Tilmeld is being used. These are:
You should modify these through client enabled methods or the $save method instead, for safety.
Protected
$protectedTags that can only be added/removed by server side code. They will still be visible on the frontend, but any changes to them that come from the frontend will be ignored.
Protected
$sdataThe actual sdata store.
Private
$skipThis should only be used by the backend.
Private
$skipThis should only be used by the backend.
Protected
$sleepingThe reference to use to wake.
Protected
$tagsProtected
$wakeA promise that resolved when the entity's data is wake.
The creation date of the entity as a Unix timestamp in milliseconds.
The entity's Globally Unique ID.
This is a 12 byte number represented as a lower case HEX string (24 characters).
The modified date of the entity as a Unix timestamp in milliseconds.
Array of the entity's tags.
Private
Static
DEFAULT_Private
Static
DEFAULT_Static
ETYPEThe instance of Tilmeld to use for queries.
Static
classThe lookup name for this entity.
This is used for reference arrays (and sleeping references) and client requests.
Static
clientThe names of static methods allowed to be called by the frontend with serverCallStatic.
Static
nymphThe instance of Nymph to use for queries.
Static
pubWhether this entity should publish changes to PubSub servers.
Static
restWhether this entity should be accessible on the frontend through the REST server.
If this is false, any request from the client that attempts to use this entity will fail.
Static
searchProperties that will not be searchable from the frontend. If the frontend includes any of these properties in any of their clauses, they will be filtered out before the search is executed.
Search the array for this object and return the corresponding index.
If strict
is false, is()
is used to compare. If strict
is true,
equals()
is used.
The array to search.
Optional
strict: booleanWhether to use stronger comparison.
The index if the object is in the array, -1 if it isn't.
Protected
$checkGet the current values of the AC properties.
An object of AC properties.
Get the number of parents the group has.
If the group is a top level group, this will return 0. If it is a child of a top level group, this will return 1. If it is a grandchild of a top level group, this will return 2, and so on.
Levels will max out at 1024 to avoid recursive loops.
The level of the group.
Get the original values of the AC properties.
An object of AC properties.
Used to retrieve the serialized data object.
This should only be used by Nymph to save the data object into storage.
This method is used by Nymph to avoid unserializing data that hasn't been requested yet.
It should always be called after getData().
The entity's serialized data object.
Get an array of strings that must be unique across the current etype.
When you try to save another entity with any of the same unique strings, Nymph will throw an error.
The default implementation of this method returns an empty array, meaning there are no uniqueness constraints applied to its etype.
Resolves to an array of entity's unique constraint strings.
Gets an array of users in the group.
Include users in all descendant groups too.
Optional
limit: numberThe limit for the query.
Optional
offset: numberThe offset for the query.
An array of users.
Check whether this object is in an array.
If strict
is false, is()
is used to compare. If strict
is true,
equals()
is used.
The array to search.
Optional
strict: booleanWhether to use stronger comparison.
True if the object is in the array, false if it isn't.
Accept JSON data from the client.
This function uses the security protection lists:
The input data. Please note, this will be modified (destroyed).
Allow to accept data that is older than the current data.
Accept JSON patch from the client.
This function uses the security protection lists:
The patch data. Please note, this will be modified (destroyed).
Allow to accept data that is older than the current data.
Used to set the data.
This should only be used by Nymph to push the data from storage.
sdata
is used by Nymph to avoid unserializing data that hasn't been
requested yet.
The data object.
Optional
sdata: SerializedEntityDataThe serialized data object.
Protected
$referenceSet up a sleeping reference.
Refresh the object from storage. (Bypasses Nymph's cache.)
If the object has been deleted from storage, the database cannot be
reached, or a database error occurs, refresh()
will return 0.
False if the data has not been saved, 0 if it can't be refreshed, true on success.
Return a Nymph Entity Reference for this entity.
If the entity hasn't been saved yet (and has no GUID), it will be returned instead.
A Nymph Entity Reference array as an unsaved entity.
Static
Optional
alterStatic
factoryCreate or retrieve a new entity instance.
Note that this will always return an entity, even if the GUID is not found.
Static
factoryStatic
factoryCreate a new sleeping reference instance.
Sleeping references won't retrieve their data from the database until they
are readied with $wake()
or a parent's $wakeAll()
.
The Nymph Entity Reference to use to wake.
The new instance.
Static
factoryCreate a new entity instance.
Private
Static
getStatic
getStatic
getStatic
getGet an array of strings that must be unique across the current etype.
When you try to save another entity with any of the same unique strings, Nymph will throw an error.
The default implementation of this static method instantiates the entity,
assigns all of the given data, then calls $getUniques
and returns its
output. This can have a performance impact if a lot of extra processing
happens during any of these steps. You can override this method to
calculate the unique strings faster, but you must return the same strings
that would be returned by $getUniques
.
Optional
cdate?: numberOptional
guid?: stringOptional
mdate?: numberOptional
sdata?: SerializedEntityDataResolves to an array of entity's unique constraint strings.
A user group data model.
Written by Hunter Perrin for SciActive.
Author
Hunter Perrin [email protected]
Copyright
SciActive Inc
See
http://nymph.io/