91 parent::initializeAttributes();
93 $this->attributes[
'guid'] = null;
94 $this->attributes[
'type'] = null;
95 $this->attributes[
'subtype'] = null;
97 $this->attributes[
'owner_guid'] =
_elgg_services()->session->getLoggedInUserGuid();
98 $this->attributes[
'container_guid'] =
_elgg_services()->session->getLoggedInUserGuid();
100 $this->attributes[
'site_guid'] = null;
102 $this->attributes[
'time_updated'] = null;
103 $this->attributes[
'last_action'] = null;
104 $this->attributes[
'enabled'] =
"yes";
123 _elgg_services()->logger->error(
"Failed to clone entity with GUID $this->guid");
128 'guid' => $this->guid,
132 $this->attributes[
'guid'] =
"";
134 $this->attributes[
'subtype'] = $orig_entity->getSubtype();
138 if (is_array($metadata_array)) {
140 $metadata_names = array();
142 $metadata_names[] = $metadata[
'name'];
145 $metadata_names = array_unique($metadata_names);
148 foreach ($metadata_names as
$name) {
149 $this->
__set($name, $orig_entity->$name);
173 if (array_key_exists(
$name, $this->attributes)) {
175 if (is_int($this->attributes[
$name])
177 && ((
string)$this->attributes[$name] ===
$value)) {
184 if (in_array($name, [
'title',
'name',
'description'])
185 && $this->attributes[$name] === null
191 if ($this->guid && !array_key_exists($name, $this->orig_attributes)) {
192 $this->orig_attributes[
$name] = $this->attributes[
$name];
204 case 'container_guid':
208 $this->attributes[
$name] = null;
218 if (
$name ===
'tables_split' ||
$name ===
'tables_loaded') {
264 if (array_key_exists(
$name, $this->attributes)) {
265 if (
$name ===
'subtype' && $this->attributes[
'guid']) {
269 return $this->attributes[
$name];
272 if (
$name ===
'tables_split' ||
$name ===
'tables_loaded') {
318 if (isset($this->temp_metadata[
$name])) {
320 if (count($this->temp_metadata[$name]) == 1) {
321 return $this->temp_metadata[
$name][0];
323 return $this->temp_metadata[
$name];
333 if ($cache->isLoaded(
$guid)) {
336 $cache->populateFromEntities(array(
$guid));
338 if ($cache->isLoaded(
$guid)) {
345 'metadata_name' =>
$name,
352 if ($md && !is_array($md)) {
354 } elseif (count($md) == 1) {
356 }
else if ($md && is_array($md)) {
374 if (array_key_exists(
$name, $this->attributes)) {
375 $this->attributes[
$name] =
"";
418 'metadata_name' =>
$name,
435 if ($access_id === null) {
436 $access_id = $this->access_id;
438 $access_id = (int)$access_id;
440 .
'All metadata will be public in 3.0.',
'2.3');
445 foreach (
$value as $value_tmp) {
447 $md_id =
_elgg_services()->metadataTable->create($this->guid,
$name, $value_tmp, $value_type,
462 $msg =
"owner guid and access id cannot be used in \ElggEntity::setMetadata() until entity is saved.";
463 throw new \InvalidArgumentException($msg);
467 if (!$multiple || !isset($this->temp_metadata[
$name])) {
468 $this->temp_metadata[
$name] = array();
472 $this->temp_metadata[
$name] = array_merge($this->temp_metadata[$name],
$value);
494 'guid' => $this->guid,
517 'metadata_owner_guid' => $this->guid,
538 'guid' => $this->guid,
559 'guid' => $this->guid,
577 return array_key_exists(
$name, $this->
volatile) ? $this->
volatile[
$name] : null;
606 $this->
volatile = [];
608 $this->attributes[
'last_action'] = (int)$last_action;
610 $cache->
save($this->guid, $this);
612 $this->
volatile = $tmp;
629 $relationship = (string)$relationship;
676 if ((
int) $this->guid > 0) {
692 if ((
int) ($this->guid) > 0) {
695 if (isset($this->temp_private_settings[
$name])) {
696 return $this->temp_private_settings[
$name];
725 'guid' => $this->guid,
748 'annotation_owner_guid' => $this->guid,
769 'guid' => $this->guid,
790 'guid' => $this->guid,
807 private function getAnnotationCalculation(
$name, $calculation) {
811 'annotation_name' =>
$name,
812 'annotation_calculation' => $calculation
835 if ((
int) $this->guid > 0) {
863 if ((
int) ($this->guid) > 0) {
866 'guid' => $this->guid,
872 if ($order !=
'asc') {
873 $options[
'reverse_order_by'] =
true;
887 if (isset($this->temp_annotations[
$name])) {
888 return array($this->temp_annotations[$name]);
903 return $this->getAnnotationCalculation(
$name,
'count');
914 return $this->getAnnotationCalculation(
$name,
'avg');
925 return $this->getAnnotationCalculation(
$name,
'sum');
936 return $this->getAnnotationCalculation(
$name,
'min');
947 return $this->getAnnotationCalculation(
$name,
'max');
957 $params = array(
'entity' => $this);
965 'subtype' =>
'comment',
966 'container_guid' => $this->
getGUID(),
994 'relationship_guid' => $this->
getGUID(),
995 'inverse_relationship' => $inverse,
1012 'relationship' => $relationship,
1013 'relationship_guid' => $this->
getGUID(),
1014 'inverse_relationship' => $inverse_relationship,
1119 return $this->access_id;
1147 if ($this->attributes[
'guid']) {
1150 return $this->attributes[
'subtype'];
1207 return $this->time_updated;
1225 if (isset($CONFIG->entity_url_handler[$this->getType()][$this->
getSubtype()])) {
1227 if (is_callable($function)) {
1228 $url = call_user_func($function, $this);
1230 } elseif (isset($CONFIG->entity_url_handler[$this->getType()][
'all'])) {
1231 $function = $CONFIG->entity_url_handler[$this->
getType()][
'all'];
1232 if (is_callable($function)) {
1233 $url = call_user_func($function, $this);
1235 } elseif (isset($CONFIG->entity_url_handler[
'all'][
'all'])) {
1236 $function = $CONFIG->entity_url_handler[
'all'][
'all'];
1237 if (is_callable($function)) {
1238 $url = call_user_func($function, $this);
1248 $params = array(
'entity' => $this);
1252 if (!empty($this->url_override)) {
1271 $this->url_override =
$url;
1387 return $site->addEntity($this);
1405 return $site->removeEntity($this);
1421 $options[
'relationship'] =
'member_of_site';
1423 $options[
'inverse_relationship'] =
false;
1487 if (!in_array(
$type, $allowed_types)) {
1488 throw new \InvalidParameterException(
'Entity type must be one of the allowed types: ' 1489 . implode(
', ', $allowed_types));
1492 $subtype = $this->attributes[
'subtype'];
1494 $owner_guid = (int)$this->attributes[
'owner_guid'];
1495 $access_id = (int)$this->attributes[
'access_id'];
1497 $time_created = isset($this->attributes[
'time_created']) ? (int)$this->attributes[
'time_created'] : $now;
1499 $site_guid = $this->attributes[
'site_guid'];
1500 if ($site_guid == 0) {
1503 $site_guid = (int)$site_guid;
1513 throw new \InvalidParameterException(
'ACCESS_DEFAULT is not a valid access level. See its documentation in elgglib.h');
1522 _elgg_services()->logger->error(
"User $user_guid tried to create a ($type, $subtype), but the given" 1523 .
" owner $owner_guid could not be loaded.");
1530 _elgg_services()->logger->error(
"User $user_guid tried to create a ($type, $subtype) with owner" 1531 .
" $owner_guid, but the user wasn't permitted to write to the owner's container.");
1540 _elgg_services()->logger->error(
"User $user_guid tried to create a ($type, $subtype), but the given" 1541 .
" container $container_guid could not be loaded.");
1546 _elgg_services()->logger->error(
"User $user_guid tried to create a ($type, $subtype), but was not" 1547 .
" permitted to write to container $container_guid.");
1554 'subtype_id' => $subtype_id,
1557 'site_guid' => $site_guid,
1558 'access_id' => $access_id,
1560 'time_updated' => $now,
1561 'last_action' => $now,
1565 throw new \IOException(
"Unable to save new object's base entity information!");
1569 $this->attributes[
'subtype'] = (int)$subtype_id;
1570 $this->attributes[
'guid'] = (int)
$result;
1572 $this->attributes[
'time_updated'] = (int)$now;
1573 $this->attributes[
'last_action'] = (int)$now;
1574 $this->attributes[
'site_guid'] = (int)$site_guid;
1584 if (
sizeof($this->temp_metadata) > 0) {
1585 foreach ($this->temp_metadata as
$name =>
$value) {
1589 $this->temp_metadata = array();
1593 if (
sizeof($this->temp_annotations) > 0) {
1594 foreach ($this->temp_annotations as
$name =>
$value) {
1598 $this->temp_annotations = array();
1602 if (
sizeof($this->temp_private_settings) > 0) {
1603 foreach ($this->temp_private_settings as
$name =>
$value) {
1607 $this->temp_private_settings = array();
1629 if (!
_elgg_services()->events->trigger(
'update', $this->type, $this)) {
1634 $guid = (int)$this->guid;
1642 throw new \InvalidParameterException(
'ACCESS_DEFAULT is not a valid access level. See its documentation in elgglib.php');
1648 'access_id' => $access_id,
1650 'time_updated' => $time,
1661 if ($ret !==
false) {
1662 $this->attributes[
'time_updated'] = $time;
1665 $this->orig_attributes = [];
1668 return $ret !==
false;
1687 if (!is_array($this->attributes)) {
1688 $this->attributes = array();
1692 $objarray = (array)
$row;
1698 $this->attributes[
'guid'] = (int)$this->attributes[
'guid'];
1701 $this->attributes[
'subtype'] = (int)$this->attributes[
'subtype'];
1704 if ($this->attributes[
'guid']) {
1740 return $this->
load($row);
1764 public function disable($reason =
"", $recursive =
true) {
1769 if (!
_elgg_services()->events->trigger(
'disable', $this->type, $this)) {
1777 if ($this instanceof
ElggUser && $this->banned ===
'no') {
1780 $unban_after =
true;
1782 $unban_after =
false;
1786 $this->disable_reason = $reason;
1791 $guid = (int) $this->guid;
1807 foreach ([
'owner_guid',
'container_guid',
'site_guid'] as $db_column) {
1811 $subentities = new \ElggBatch(
'elgg_get_entities',
$options);
1812 $subentities->setIncrementOffset(
false);
1814 foreach ($subentities as $subentity) {
1816 if (!$subentity->isEnabled()) {
1820 $subentity->disable($reason);
1834 UPDATE {$dbprefix}entities 1848 $this->attributes[
'enabled'] =
'no';
1852 return (
bool) $disabled;
1866 $guid = (int)$this->guid;
1887 WHERE guid = $guid");
1895 'relationship' =>
'disabled_with',
1896 'relationship_guid' =>
$guid,
1897 'inverse_relationship' =>
true,
1901 foreach ($disabled_with_it as
$e) {
1910 $this->attributes[
'enabled'] =
'yes';
1923 return $this->enabled ==
'yes';
1943 public function delete($recursive =
true) {
1985 foreach ([
'owner_guid',
'container_guid',
'site_guid'] as $db_column) {
1989 $batch = new \ElggBatch(
'elgg_get_entities',
$options);
1990 $batch->setIncrementOffset(
false);
1993 foreach ($batch as
$e) {
2029 DELETE FROM {$dbprefix}entities 2038 if ($deleted && in_array($this->
type, [
'object',
'user',
'group',
'site'])) {
2041 DELETE FROM {$dbprefix}{$this->type}s_entity 2049 return (
bool)$deleted;
2057 $params = array(
'entity' => $this);
2092 return $this->location;
2103 $this->location = $location;
2116 $this->{
"geo:lat"} = $lat;
2117 $this->{
"geo:long"} = $long;
2127 return (
float)$this->{
"geo:lat"};
2137 return (
float)$this->{
"geo:long"};
2182 $this->attributes[
'type'],
2191 foreach ($this->attributes as $k => $v) {
2201 case 'time_created':
2202 $odd->setAttribute(
'published', date(
"r", $v));
2208 $meta =
new ODDMetaData($uuid .
"attr/$k/", $uuid, $k, $v);
2211 case 'container_guid':
2212 $k =
'container_uuid';
2214 $meta =
new ODDMetaData($uuid .
"attr/$k/", $uuid, $k, $v);
2220 $meta =
new ODDMetaData($uuid .
"attr/$k/", $uuid, $k, $v);
2224 $meta =
new ODDMetaData($uuid .
"attr/$k/", $uuid, $k, $v);
2229 $meta->setAttribute(
'published', date(
"r", $this->time_created));
2244 $tmp[] =
new ODDMetaData($uuid .
"volatile/renderedentity/", $uuid,
2245 'renderedentity',
$view,
'volatile');
2267 throw new \InvalidParameterException(
"import() passed an unexpected ODD class");
2271 $this->attributes[
'type'] =
$data->getAttribute(
'class');
2272 $this->attributes[
'subtype'] =
$data->getAttribute(
'subclass');
2275 $this->attributes[
'owner_guid'] =
_elgg_services()->session->getLoggedInUserGuid();
2278 $this->attributes[
'time_created'] = strtotime(
$data->getAttribute(
'published'));
2279 $this->attributes[
'time_updated'] = $this->
getCurrentTime()->getTimestamp();
2319 if ($tag_names && !is_array($tag_names)) {
2320 $tag_names = array($tag_names);
2324 $entity_tags = array();
2326 foreach ($valid_tags as $tag_name) {
2327 if (is_array($tag_names) && !in_array($tag_name, $tag_names)) {
2331 if (
$tags = $this->$tag_name) {
2334 if (is_array(
$tags)) {
2335 $entity_tags = array_merge($entity_tags,
$tags);
2337 $entity_tags[] =
$tags;
2342 return $entity_tags;
2357 if ($this->
type !==
'user') {
2363 $collections = $ac->getCollectionsByMember($this->guid);
2364 if (empty($collections)) {
2370 $result =
$result & $ac->removeUser($this->guid, $collection->id);
2390 $collections = $ac->getEntityCollections($this->guid);
2391 if (empty($collections)) {
2416 $this->attributes[
'last_action'] =
$posted;
deleteOwnedAccessCollections()
Remove all access collections owned by this entity.
$object
These two snippets demonstrates triggering an event and how to register for that event.
elgg_get_config($name, $site_guid=0)
Get an Elgg configuration value.
enable($recursive=true)
Enable the entity.
getSubtype()
Get the entity subtype.
canEditMetadata($metadata=null, $user_guid=0)
Can a user edit metadata on this entity?
getDatabase()
Provides a pointer to the database object.
refresh(\stdClass $row)
Load new data from database into existing entity.
getOwnerGUID()
Get the guid of the entity's owner.
getTimeCreated()
Returns the UNIX epoch time that this entity was created.
if(!array_key_exists($filename, $text_files)) $file
_elgg_invalidate_cache_for_entity($entity_guid)
Invalidate entity cache.
Entities that support icons should implement this interface.
__clone()
Clone an entity.
deleteIcon($type= 'icon')
Removes all icon files and metadata for the passed type of icon.
getAnnotations($options=array(), $limit=50, $offset=0, $order="asc")
Gets an array of annotations.
__get($name)
Get an attribute or metadata value.
create_annotation($entity_guid, $name, $value, $value_type= '', $owner_guid=0, $access_id=ACCESS_PRIVATE)
Create a new annotation.
loadAdditionalSelectValues(array $data)
Stores non-attributes from the loading of the entity as volatile data.
getOwnerEntity()
Gets the that owns this entity.
remove_all_private_settings($entity_guid)
Deletes all private settings for an entity.
add_entity_relationship($guid_one, $relationship, $guid_two)
Create a relationship between two entities.
if($guid==elgg_get_logged_in_user_guid()) $name
setLatLong($lat, $long)
Set latitude and longitude metadata tags for a given entity.
removePrivateSetting($name)
Removes private setting.
disableAnnotations($name= '')
Disables annotations for this entity, optionally based on name.
prepareObject($object)
Prepare an object copy for toObject()
remove_entity_relationship($guid_one, $relationship, $guid_two)
Delete a relationship between two entities.
deleteMetadata($name=null)
Deletes all metadata on this object (metadata.entity_guid = $this->guid).
elgg_delete_annotations(array $options)
Deletes annotations based on $options.
countAnnotations($name="")
Count annotations.
deleteAnnotations($name=null)
Deletes all annotations on this object (annotations.entity_guid = $this->guid).
$CONFIG site_guid
The guid of the current site object.
setPrivateSetting($name, $value)
Adds a private setting to this entity.
saveIconFromUploadedFile($input_name, $type= 'icon', array $coords=array())
Saves icons using an uploaded file as the source.
initializeAttributes()
Initialize the attributes array.
canWriteToContainer($user_guid=0, $type= 'all', $subtype= 'all')
Can a user add an entity to this container.
_elgg_delete_river(array $options=[])
Alias of elgg_delete_river() that doesn't raise notices.
getPrivateSetting($name)
Returns a private setting value.
deleteOwnedMetadata($name=null)
Deletes all metadata owned by this object (metadata.owner_guid = $this->guid).
getAnnotationsMax($name)
Get the maximum of integer type annotations of a given name.
countComments()
Count the number of comments attached to this entity.
get_subtype_from_id($subtype_id)
Gets the denormalized string for a given subtype ID.
setMetadata($name, $value, $value_type= '', $multiple=false, $owner_guid=0, $access_id=null)
Set metadata on this entity.
deleteOwnedAnnotations($name=null)
Deletes all annotations owned by this object (annotations.owner_guid = $this->guid).
if($title=== ''&&$entity instanceof ElggEntity) $tags
isFullyLoaded()
Tests to see whether the object has been persisted.
getGUID()
Returns the guid.
getCurrentTime($modifier= '')
Get the (cloned) time.
disableMetadata($name= '')
Disables metadata for this entity, optionally based on name.
$guid
Removes an admin notice.
getContainerGUID()
Gets the container GUID for this entity.
getTimeUpdated()
Returns the UNIX epoch time that this entity was last updated.
saveIconFromLocalFile($filename, $type= 'icon', array $coords=array())
Saves icons using a local file as the source.
_elgg_get_memcache($namespace= 'default')
Get a namespaced ElggMemcache object (if memcache is available) or a null cache.
storeInPersistedCache(\ElggSharedMemoryCache $cache, $last_action=0)
Cache the entity in a persisted cache.
enableAnnotations($name= '')
Enables annotations for this entity, optionally based on name.
canEdit($user_guid=0)
Can a user edit this entity?
export()
Export this class into an array of ODD Elements containing all necessary fields.
getIcon($size, $type= 'icon')
Returns entity icon as an ElggIcon object The icon file may or may not exist on filestore.
remove_entity_relationships($guid, $relationship="", $inverse_relationship=false, $type= '')
Removes all relationships originating from a particular entity.
getAnnotationsSum($name)
Get the sum of integer type annotations of a given name.
getSites($options=array())
Gets the sites this entity is a member of.
setVolatileData($name, $value)
Set a piece of volatile (non-persisted) data on this entity.
_elgg_invalidate_memcache_for_entity($entity_guid)
Invalidate an entity in memcache.
setContainerGUID($container_guid)
Set the container for this object.
removeRelationship($guid_two, $relationship)
Remove a relationship.
elgg_disable_annotations(array $options)
Disables annotations based on $options.
update_river_access_by_object($object_guid, $access_id)
Sets the access ID on river items for a particular object.
saveIconFromElggFile(\ElggFile $file, $type= 'icon', array $coords=array())
Saves icons using a file located in the data store as the source.
countEntitiesFromRelationship($relationship, $inverse_relationship=false)
Gets the number of entities from a specific relationship type.
getMetadata($name)
Return the value of a piece of metadata.
getEntitiesFromRelationship($options=array(), $inverse=false, $limit=50, $offset=0)
Gets an array of entities with a relationship to this entity.
deleteRelationships($relationship=null)
Remove all relationships to and from this entity.
getExportableValues()
Returns an array of fields which can be exported.
elgg_instanceof($entity, $type=null, $subtype=null, $class=null)
Checks if $entity is an and optionally for type and subtype.
getTags($tag_names=null)
Returns tags for this entity.
add_subtype($type, $subtype, $class="")
Register with a certain type and subtype to be loaded as a specific class.
annotate($name, $value, $access_id=ACCESS_PRIVATE, $owner_guid=0, $vartype="")
Adds an annotation to an entity.
$temp_annotations
Holds annotations until entity is saved.
getVolatileData($name)
Get a piece of volatile (non-persisted) data on this entity.
remove_private_setting($entity_guid, $name)
Deletes a private setting for an entity.
elgg_set_ignore_access($ignore=true)
Set if Elgg's access system should be ignored.
elgg_view_entity(\ElggEntity $entity, array $vars=array(), $bypass=false, $debug=false)
Returns a string of a rendered entity.
getAnnotationsAvg($name)
Get the average of an integer type annotation.
setLocation($location)
Sets the 'location' metadata for the entity.
__set($name, $value)
Set an attribute or metadata value for this entity.
elgg_set_viewtype($viewtype="")
Manually set the viewtype.
const ELGG_ENTITIES_ANY_VALUE
$temp_metadata
Holds metadata until entity is saved.
elgg_get_entities(array $options=array())
Returns an array of entities with optional filtering.
canAnnotate($user_guid=0, $annotation_name= '')
Can a user annotate an entity?
save($key, $data)
Save data in a cache.
elgg_enable_annotations(array $options)
Enables annotations based on $options.
elgg_deprecated_notice($msg, $dep_version, $backtrace_level=1)
Log a notice about deprecated use of a function, view, etc.
elgg global
Pointer to the global context.
getIconURL($params=array())
Get the URL for this entity's icon.
$orig_attributes
Holds the original (persisted) attribute values that have been changed but not yet saved...
_elgg_services(\Elgg\Di\ServiceProvider $services=null)
Get the global service provider.
access_get_show_hidden_status()
Return current status of showing disabled entities.
deleteAccessCollectionMemberships()
Remove the membership of all access collections for this entity (if the entity is a user) ...
isEnabled()
Is this entity enabled?
get_entity_as_row($guid)
Returns a database row from the entities table.
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
addRelationship($guid_two, $relationship)
Add a relationship between this an another entity.
update()
Update the entity in the database.
getAccessID()
Returns the access_id.
guid_to_uuid($guid)
Generate a UUID from a given GUID.
$temp_private_settings
Holds private settings until entity is saved.
canDelete($user_guid=0)
Can a user delete this entity?
access_show_hidden_entities($show_hidden)
Show or hide disabled entities.
hasIcon($size, $type= 'icon')
Returns if the entity has an icon of the passed type.
getType()
Returns the entity type.
elgg_get_annotations(array $options=array())
Returns annotations.
setDisplayName($displayName)
Sets the title or name of this entity.
create()
Create a new entry in the entities table.
getIconLastChange($size, $type= 'icon')
Returns the timestamp of when the icon was changed.
elgg_trigger_after_event($event, $object_type, $object=null)
Trigger an "After event" indicating a process has finished.
getOriginalAttributes()
Get the original values of attribute(s) that have been modified since the entity was persisted...
setURL($url)
Overrides the URL returned by getURL()
set_private_setting($entity_guid, $name, $value)
Sets a private setting for an entity.
updateLastAction($posted=null)
Update the last_action column in the entities table.
getLocation()
Gets the 'location' metadata for the entity.
getLatitude()
Return the entity's latitude.
getContainerEntity()
Get the container entity for this object.
elgg_get_entities_from_relationship($options)
Return entities matching a given query joining against a relationship.
removeFromSite($site)
Remove this entity from a site.
get_private_setting($entity_guid, $name)
Gets a private setting for an entity.
if(!$owner||!($owner instanceof ElggUser)||!$owner->canEdit()) $coords
__unset($name)
Unset a property from metadata or attribute.
$user_guid
Avatar remove action.
canComment($user_guid=0, $default=null)
Can a user comment on an entity?
if(!$collection_name) $id
getSystemLogID()
Return an identification for the object for storage in the system log.
enableMetadata($name= '')
Enables metadata for this entity, optionally based on name.
disable($reason="", $recursive=true)
Disable this entity.
getURL()
Gets the URL for this entity.
elgg_get_logged_in_user_guid()
Return the current logged in user by guid.
load($guid)
Loads attributes from the entities table into the object.
_elgg_clear_entity_files($entity)
Removes all entity files.
getDisplayName()
Get the entity's display name.
getAnnotationsMin($name)
Get the minimum of integer type annotations of given name.
getLongitude()
Return the entity's longitude.
get_entity($guid)
Loads and returns an entity object from a guid.
getObjectFromID($id)
For a given ID, return the object associated with it.
addToSite($site)
Add this entity to a site.
$url_override
If set, overrides the value of getURL()
$volatile
Volatile data structure for this object, allows for storage of data in-memory that isn't sync'd back ...