Elgg
Version 4.3
|
Public Member Functions | |
__construct (stdClass $row=null) | |
Create a new entity. More... | |
__clone () | |
Clone an entity. More... | |
__set ($name, $value) | |
Set an attribute or metadata value for this entity. More... | |
getOriginalAttributes () | |
Get the original values of attribute(s) that have been modified since the entity was persisted. More... | |
__get ($name) | |
Get an attribute or metadata value. More... | |
getDisplayName () | |
Get the entity's display name. More... | |
setDisplayName ($display_name) | |
Sets the title or name of this entity. More... | |
getMetadata ($name) | |
Return the value of a piece of metadata. More... | |
getAllMetadata () | |
Get all entity metadata. More... | |
setMetadata ($name, $value, $value_type= '', $multiple=false) | |
Set metadata on this entity. More... | |
deleteMetadata ($name=null) | |
Deletes all metadata on this object (metadata.entity_guid = $this->guid). More... | |
getVolatileData ($name) | |
Get a piece of volatile (non-persisted) data on this entity. More... | |
setVolatileData ($name, $value) | |
Set a piece of volatile (non-persisted) data on this entity. More... | |
addRelationship ($guid_two, $relationship) | |
Add a relationship between this an another entity. More... | |
hasRelationship (int $guid_two, string $relationship) | |
Check if this entity has a relationship with another entity. More... | |
getRelationship (int $guid_two, string $relationship) | |
Return the relationship if this entity has a relationship with another entity. More... | |
getEntitiesFromRelationship (array $options=[]) | |
Gets an array of entities with a relationship to this entity. More... | |
countEntitiesFromRelationship ($relationship, $inverse_relationship=false) | |
Gets the number of entities from a specific relationship type. More... | |
removeRelationship ($guid_two, $relationship) | |
Remove a relationship. More... | |
removeAllRelationships (string $relationship=null, bool $inverse_relationship=false) | |
Remove all relationships to or from this entity. More... | |
deleteRelationships ($relationship=null) | |
Remove all relationships to and from this entity. More... | |
setPrivateSetting ($name, $value) | |
Adds a private setting to this entity. More... | |
getPrivateSetting ($name) | |
Returns a private setting value. More... | |
getAllPrivateSettings () | |
Returns all private settings. More... | |
removePrivateSetting ($name) | |
Removes private setting. More... | |
removeAllPrivateSettings () | |
Removes all private settings. More... | |
removeAllRelatedRiverItems () | |
Removes all river items related to this entity. More... | |
deleteAnnotations ($name=null) | |
Deletes all annotations on this object (annotations.entity_guid = $this->guid). More... | |
deleteOwnedAnnotations ($name=null) | |
Deletes all annotations owned by this object (annotations.owner_guid = $this->guid). More... | |
disableAnnotations ($name= '') | |
Disables annotations for this entity, optionally based on name. More... | |
enableAnnotations ($name= '') | |
Enables annotations for this entity, optionally based on name. More... | |
annotate ($name, $value, $access_id=ACCESS_PRIVATE, $owner_guid=0, $value_type="") | |
Adds an annotation to an entity. More... | |
getAnnotations (array $options=[]) | |
Gets an array of annotations. More... | |
countAnnotations ($name="") | |
Count annotations. More... | |
getAnnotationsAvg ($name) | |
Get the average of an integer type annotation. More... | |
getAnnotationsSum ($name) | |
Get the sum of integer type annotations of a given name. More... | |
getAnnotationsMin ($name) | |
Get the minimum of integer type annotations of given name. More... | |
getAnnotationsMax ($name) | |
Get the maximum of integer type annotations of a given name. More... | |
countComments () | |
Count the number of comments attached to this entity. More... | |
getOwnedAccessCollections ($options=[]) | |
Returns the ACLs owned by the entity. More... | |
getOwnedAccessCollection ($subtype) | |
Returns the first ACL owned by the entity with a given subtype. More... | |
hasAccess (int $user_guid=0) | |
Check if the given user has access to this entity. More... | |
canEdit ($user_guid=0) | |
Can a user edit this entity? More... | |
canDelete ($user_guid=0) | |
Can a user delete this entity? More... | |
canWriteToContainer ($user_guid=0, $type= '', $subtype= '') | |
Can a user add an entity to this container. More... | |
canComment ($user_guid=0, $default=null) | |
Can a user comment on an entity? More... | |
canAnnotate ($user_guid=0, $annotation_name= '') | |
Can a user annotate an entity? More... | |
getAccessID () | |
Returns the access_id. More... | |
getGUID () | |
Returns the guid. More... | |
getType () | |
Returns the entity type. More... | |
setSubtype (string $subtype) | |
Set the subtype of the entity. More... | |
getSubtype () | |
Get the entity subtype. More... | |
getOwnerGUID () | |
Get the guid of the entity's owner. More... | |
getOwnerEntity () | |
Gets the that owns this entity. More... | |
setContainerGUID ($container_guid) | |
Set the container for this object. More... | |
getContainerGUID () | |
Gets the container GUID for this entity. More... | |
getContainerEntity () | |
Get the container entity for this object. More... | |
getTimeUpdated () | |
Returns the UNIX epoch time that this entity was last updated. More... | |
getURL () | |
Gets the URL for this entity. More... | |
saveIconFromUploadedFile ($input_name, $type= 'icon', array $coords=[]) | |
Saves icons using an uploaded file as the source. More... | |
saveIconFromLocalFile ($filename, $type= 'icon', array $coords=[]) | |
Saves icons using a local file as the source. More... | |
saveIconFromElggFile (\ElggFile $file, $type= 'icon', array $coords=[]) | |
Saves icons using a file located in the data store as the source. More... | |
getIcon ($size, $type= 'icon') | |
Returns entity icon as an ElggIcon object The icon file may or may not exist on filestore. More... | |
deleteIcon ($type= 'icon') | |
Removes all icon files and metadata for the passed type of icon. More... | |
getIconLastChange ($size, $type= 'icon') | |
Returns the timestamp of when the icon was changed. More... | |
hasIcon ($size, $type= 'icon') | |
Returns if the entity has an icon of the passed type. More... | |
getIconURL ($params=[]) | |
Get the URL for this entity's icon. More... | |
save () | |
disable ($reason="", $recursive=true) | |
Disable this entity. More... | |
enable ($recursive=true) | |
Enable the entity. More... | |
isEnabled () | |
Is this entity enabled? More... | |
delete ($recursive=true) | |
Deletes the entity. More... | |
toObject (array $params=[]) | |
Export an entity. More... | |
setLatLong (float $lat, float $long) | |
Set latitude and longitude metadata tags for a given entity. More... | |
getLatitude () | |
Return the entity's latitude. More... | |
getLongitude () | |
Return the entity's longitude. More... | |
getSystemLogID () | |
Return an identification for the object for storage in the system log. More... | |
getObjectFromID ($id) | |
For a given ID, return the object associated with it. More... | |
getTags ($tag_names=null) | |
Returns tags for this entity. More... | |
deleteAccessCollectionMemberships () | |
Remove the membership of all access collections for this entity (if the entity is a user) More... | |
deleteOwnedAccessCollections () | |
Remove all access collections owned by this entity. More... | |
updateLastAction ($posted=null) | |
Update the last_action column in the entities table. More... | |
disableCaching () | |
Disable runtime caching for entity. More... | |
enableCaching () | |
Enable runtime caching for entity. More... | |
isCacheable () | |
Is entity cacheable in the runtime cache. More... | |
cache ($persist=true) | |
Cache the entity in a session and persisted caches. More... | |
invalidateCache () | |
Invalidate cache for entity. More... | |
hasCapability (string $capability) | |
Checks a specific capability is enabled for the entity type/subtype. More... | |
![]() | |
__isset ($name) | |
Test if property is set either as an attribute or metadata. More... | |
__unset ($name) | |
Unset a property from metadata or attribute. More... | |
getURL () | |
Get a URL for this object. More... | |
save () | |
Save this data to the appropriate database table. More... | |
delete () | |
Delete this data. More... | |
getTimeCreated () | |
Returns the UNIX epoch time that this entity was created. More... | |
toObject (array $params=[]) | |
Get a plain old object copy for public consumption. More... | |
rewind () | |
Iterator interface. More... | |
current () | |
Iterator interface. More... | |
key () | |
Iterator interface. More... | |
next () | |
Iterator interface. More... | |
valid () | |
Iterator interface. More... | |
offsetSet ($key, $value) | |
Array access interface. More... | |
offsetGet ($key) | |
Array access interface. More... | |
offsetUnset ($key) | |
Array access interface. More... | |
offsetExists ($offset) | |
Array access interface. More... | |
getID () | |
{Get unique item identifier within a collection.
| |
getPriority () | |
{Get priority (weight) of the item within a collection.
| |
__serialize () | |
Called during serialization. More... | |
__unserialize (array $data) | |
Called during unserialization. More... | |
Public Attributes | |
const | PRIMARY_ATTR_NAMES |
Protected Member Functions | |
initializeAttributes () | |
Initialize the attributes array. More... | |
setTempMetadata ($name, $value, $multiple=false) | |
Set temp metadata on this entity. More... | |
create () | |
Create a new entry in the entities table. More... | |
update () | |
Update the entity in the database. More... | |
load (stdClass $row) | |
Loads attributes from the entities table into the object. More... | |
prepareObject (\Elgg\Export\Entity $object) | |
Prepare an object copy for toObject() More... | |
![]() | |
initializeAttributes () | |
Initialize the attributes array. More... | |
getDatabase () | |
Provides a pointer to the database object. More... | |
Protected Attributes | |
const | INTEGER_ATTR_NAMES |
$temp_metadata = [] | |
$temp_annotations = [] | |
$temp_private_settings = [] | |
$volatile = [] | |
$orig_attributes = [] | |
$_is_cacheable = true | |
$_cached_metadata | |
![]() | |
$attributes = [] | |
$valid = false | |
Definition at line 46 of file ElggEntity.php.
ElggEntity::__construct | ( | stdClass | $row = null | ) |
Create a new entity.
Plugin developers should only use the constructor to create a new entity. To retrieve entities, use get_entity() and the elgg_get_entities* functions.
If no arguments are passed, it creates a new entity. If a database result is passed as a instance, it instantiates that entity.
stdClass | $row | Database row result. Default is null to create a new object. |
IOException | If cannot load remaining data from db |
Definition at line 141 of file ElggEntity.php.
ElggEntity::__clone | ( | ) |
Clone an entity.
Resets the guid so that the entity can be saved as a distinct entity from the original. Creation time will be set when this new entity is saved. The owner and container guids come from the original entity. The clone method copies metadata but does not copy annotations or private settings.
Definition at line 183 of file ElggEntity.php.
ElggEntity::__get | ( | $name | ) |
Get an attribute or metadata value.
If the name matches an attribute, the attribute is returned. If metadata does not exist with that name, a null is returned.
This only returns an array if there are multiple values for a particular $name key.
string | $name | Name of the attribute or metadata |
Definition at line 305 of file ElggEntity.php.
ElggEntity::__set | ( | $name, | |
$value | |||
) |
Set an attribute or metadata value for this entity.
Anything that is not an attribute is saved as metadata.
Be advised that metadata values are cast to integer or string. You can save booleans, but they will be stored and returned as integers.
string | $name | Name of the attribute or metadata |
mixed | $value | The value to be set |
Definition at line 235 of file ElggEntity.php.
ElggEntity::addRelationship | ( | $guid_two, | |
$relationship | |||
) |
Add a relationship between this an another entity.
Read the relationship like "This entity is a $relationship of $guid_two."
int | $guid_two | GUID of the target entity of the relationship |
string | $relationship | The type of relationship |
Definition at line 557 of file ElggEntity.php.
ElggEntity::annotate | ( | $name, | |
$value, | |||
$access_id = ACCESS_PRIVATE , |
|||
$owner_guid = 0 , |
|||
$value_type = "" |
|||
) |
Adds an annotation to an entity.
string | $name | Annotation name |
mixed | $value | Annotation value |
int | $access_id | Access ID |
int | $owner_guid | GUID of the annotation owner |
string | $value_type | The type of annotation value |
Definition at line 909 of file ElggEntity.php.
ElggEntity::cache | ( | $persist = true | ) |
Cache the entity in a session and persisted caches.
bool | $persist | Store in persistent cache |
Definition at line 2101 of file ElggEntity.php.
ElggEntity::canAnnotate | ( | $user_guid = 0 , |
|
$annotation_name = '' |
|||
) |
Can a user annotate an entity?
Can be overridden by registering for the plugin hook [permissions_check:annotate:<name>, <entity type>="">] or [permissions_check:annotate, <entity type>="">]. The hooks are called in that order.
If you want logged out users to annotate an object, do not call canAnnotate(). It's easier than using the plugin hook.
int | $user_guid | User guid (default is logged in user) |
string | $annotation_name | The name of the annotation (default is unspecified) |
Definition at line 1164 of file ElggEntity.php.
ElggEntity::canComment | ( | $user_guid = 0 , |
|
$default = null |
|||
) |
Can a user comment on an entity?
Can be overridden by registering for the permissions_check:comment, <entity type>=""> plugin hook.
int | $user_guid | User guid (default is logged in user) |
bool | $default | Default permission |
Definition at line 1146 of file ElggEntity.php.
ElggEntity::canDelete | ( | $user_guid = 0 | ) |
Can a user delete this entity?
Can be overridden by registering for the permissions_check:delete plugin hook.
int | $user_guid | The user GUID, optionally (default: logged in user) |
Definition at line 1113 of file ElggEntity.php.
ElggEntity::canEdit | ( | $user_guid = 0 | ) |
Can a user edit this entity?
Can be overridden by registering for the permissions_check plugin hook.
int | $user_guid | The user GUID, optionally (default: logged in user) |
Definition at line 1099 of file ElggEntity.php.
ElggEntity::canWriteToContainer | ( | $user_guid = 0 , |
|
$type = '' , |
|||
$subtype = '' |
|||
) |
Can a user add an entity to this container.
int | $user_guid | The GUID of the user creating the entity (0 for logged in user). |
string | $type | The type of entity we're looking to write |
string | $subtype | The subtype of the entity we're looking to write |
Definition at line 1127 of file ElggEntity.php.
ElggEntity::countAnnotations | ( | $name = "" | ) |
Count annotations.
string | $name | The type of annotation. |
Definition at line 971 of file ElggEntity.php.
ElggEntity::countComments | ( | ) |
Count the number of comments attached to this entity.
Definition at line 1025 of file ElggEntity.php.
ElggEntity::countEntitiesFromRelationship | ( | $relationship, | |
$inverse_relationship = false |
|||
) |
Gets the number of entities from a specific relationship type.
string | $relationship | Relationship type (eg "friends") |
bool | $inverse_relationship | Invert relationship |
Definition at line 612 of file ElggEntity.php.
|
protected |
Create a new entry in the entities table.
Saves the base information in the entities table for the entity. Saving the type-specific information is handled in the calling class method.
InvalidParameterException | If the entity's type has not been set. |
IOException | If the new row fails to write to the DB. |
Definition at line 1438 of file ElggEntity.php.
ElggEntity::delete | ( | $recursive = true | ) |
Deletes the entity.
Removes the entity and its metadata, annotations, relationships, river entries, and private data.
Optionally can remove entities contained and owned by this entity.
bool | $recursive | If true (default) then all entities which are owned or contained by $this will also be deleted. |
Definition at line 1838 of file ElggEntity.php.
ElggEntity::deleteAccessCollectionMemberships | ( | ) |
Remove the membership of all access collections for this entity (if the entity is a user)
Definition at line 1984 of file ElggEntity.php.
ElggEntity::deleteAnnotations | ( | $name = null | ) |
Deletes all annotations on this object (annotations.entity_guid = $this->guid).
If you pass a name, only annotations matching that name will be deleted.
null | string | $name | The annotations name to remove. |
Definition at line 792 of file ElggEntity.php.
ElggEntity::deleteIcon | ( | $type = 'icon' | ) |
Removes all icon files and metadata for the passed type of icon.
string | $type | The name of the icon. e.g., 'icon', 'cover_photo' |
Implements Elgg\EntityIcon.
Definition at line 1354 of file ElggEntity.php.
ElggEntity::deleteMetadata | ( | $name = null | ) |
Deletes all metadata on this object (metadata.entity_guid = $this->guid).
If you pass a name, only metadata matching that name will be deleted.
null | string | $name | The name of the metadata to remove. |
Definition at line 495 of file ElggEntity.php.
ElggEntity::deleteOwnedAccessCollections | ( | ) |
Remove all access collections owned by this entity.
Definition at line 2015 of file ElggEntity.php.
ElggEntity::deleteOwnedAnnotations | ( | $name = null | ) |
Deletes all annotations owned by this object (annotations.owner_guid = $this->guid).
If you pass a name, only annotations matching that name will be deleted.
null | string | $name | The name of annotations to delete. |
Definition at line 822 of file ElggEntity.php.
ElggEntity::deleteRelationships | ( | $relationship = null | ) |
Remove all relationships to and from this entity.
If you pass a relationship name, only relationships matching that name will be deleted.
null | string | $relationship | The name of the relationship to remove |
Definition at line 662 of file ElggEntity.php.
ElggEntity::disable | ( | $reason = "" , |
|
$recursive = true |
|||
) |
Disable this entity.
Disabled entities are not returned by getter functions. To enable an entity, use ElggEntity::enable().Recursivelydisablinganentitywilldisableallentitiesownedorcontainedbytheparententity.@noteInternal:Disablinganentitysetsthe'enabled'columnto'no'.@paramstring$reasonOptionalreason@parambool$recursiveRecursivelydisableallcontainedentities?@returnbool@see\ElggEntity::enable()
Definition at line 1683 of file ElggEntity.php.
ElggEntity::disableAnnotations | ( | $name = '' | ) |
Disables annotations for this entity, optionally based on name.
string | $name | An options name of annotations to disable. |
Definition at line 841 of file ElggEntity.php.
ElggEntity::disableCaching | ( | ) |
ElggEntity::enable | ( | $recursive = true | ) |
Enable the entity.
bool | $recursive | Recursively enable all entities disabled with the entity? |
Definition at line 1766 of file ElggEntity.php.
ElggEntity::enableAnnotations | ( | $name = '' | ) |
Enables annotations for this entity, optionally based on name.
string | $name | An options name of annotations to enable. |
Definition at line 860 of file ElggEntity.php.
ElggEntity::enableCaching | ( | ) |
ElggEntity::getAccessID | ( | ) |
ElggEntity::getAllMetadata | ( | ) |
ElggEntity::getAllPrivateSettings | ( | ) |
ElggEntity::getAnnotations | ( | array | $options = [] | ) |
Gets an array of annotations.
To retrieve annotations on an unsaved entity, pass array('name' => [annotation name]) as the options array.
array | $options | Array of options for elgg_get_annotations() except guid. |
Definition at line 948 of file ElggEntity.php.
ElggEntity::getAnnotationsAvg | ( | $name | ) |
Get the average of an integer type annotation.
string | $name | Annotation name |
Definition at line 982 of file ElggEntity.php.
ElggEntity::getAnnotationsMax | ( | $name | ) |
Get the maximum of integer type annotations of a given name.
string | $name | Annotation name |
Definition at line 1015 of file ElggEntity.php.
ElggEntity::getAnnotationsMin | ( | $name | ) |
Get the minimum of integer type annotations of given name.
string | $name | Annotation name |
Definition at line 1004 of file ElggEntity.php.
ElggEntity::getAnnotationsSum | ( | $name | ) |
Get the sum of integer type annotations of a given name.
string | $name | Annotation name |
Definition at line 993 of file ElggEntity.php.
ElggEntity::getContainerEntity | ( | ) |
Get the container entity for this object.
Definition at line 1267 of file ElggEntity.php.
ElggEntity::getContainerGUID | ( | ) |
ElggEntity::getDisplayName | ( | ) |
Get the entity's display name.
Definition at line 318 of file ElggEntity.php.
ElggEntity::getEntitiesFromRelationship | ( | array | $options = [] | ) |
Gets an array of entities with a relationship to this entity.
array | $options | Options array. See elgg_get_entities() for a list of options. 'relationship_guid' is set to this entity |
Definition at line 599 of file ElggEntity.php.
ElggEntity::getGUID | ( | ) |
ElggEntity::getIcon | ( | $size, | |
$type = 'icon' |
|||
) |
Returns entity icon as an ElggIcon object The icon file may or may not exist on filestore.
string | $size | Size of the icon |
string | $type | The name of the icon. e.g., 'icon', 'cover_photo' |
Implements Elgg\EntityIcon.
Definition at line 1344 of file ElggEntity.php.
ElggEntity::getIconLastChange | ( | $size, | |
$type = 'icon' |
|||
) |
Returns the timestamp of when the icon was changed.
string | $size | The size of the icon |
string | $type | The name of the icon. e.g., 'icon', 'cover_photo' |
Implements Elgg\EntityIcon.
Definition at line 1366 of file ElggEntity.php.
ElggEntity::getIconURL | ( | $params = [] | ) |
Get the URL for this entity's icon.
Plugins can register for the 'entity:icon:url', <type> plugin hook to customize the icon for an entity.
mixed | $params | A string defining the size of the icon (e.g. tiny, small, medium, large) or an array of parameters including 'size' |
Implements Elgg\EntityIcon.
Definition at line 1392 of file ElggEntity.php.
ElggEntity::getLatitude | ( | ) |
ElggEntity::getLongitude | ( | ) |
ElggEntity::getMetadata | ( | $name | ) |
Return the value of a piece of metadata.
string | $name | Name |
Definition at line 339 of file ElggEntity.php.
ElggEntity::getObjectFromID | ( | $id | ) |
For a given ID, return the object associated with it.
This is used by the system log. It can be called on any Loggable object.
int | $id | GUID. |
Definition at line 1939 of file ElggEntity.php.
ElggEntity::getOriginalAttributes | ( | ) |
Get the original values of attribute(s) that have been modified since the entity was persisted.
Definition at line 289 of file ElggEntity.php.
ElggEntity::getOwnedAccessCollection | ( | $subtype | ) |
Returns the first ACL owned by the entity with a given subtype.
string | $subtype | subtype of the ACL |
Definition at line 1064 of file ElggEntity.php.
ElggEntity::getOwnedAccessCollections | ( | $options = [] | ) |
Returns the ACLs owned by the entity.
array | $options | additional options to get the access collections with |
Definition at line 1050 of file ElggEntity.php.
ElggEntity::getOwnerEntity | ( | ) |
Gets the that owns this entity.
Definition at line 1237 of file ElggEntity.php.
ElggEntity::getOwnerGUID | ( | ) |
Get the guid of the entity's owner.
Definition at line 1228 of file ElggEntity.php.
ElggEntity::getPrivateSetting | ( | $name | ) |
Returns a private setting value.
string | $name | Name of the private setting |
Definition at line 720 of file ElggEntity.php.
ElggEntity::getRelationship | ( | int | $guid_two, |
string | $relationship | ||
) |
Return the relationship if this entity has a relationship with another entity.
int | $guid_two | GUID of the target entity of the relationship |
string | $relationship | The type of relationship |
Definition at line 585 of file ElggEntity.php.
ElggEntity::getSubtype | ( | ) |
Get the entity subtype.
Definition at line 1219 of file ElggEntity.php.
ElggEntity::getSystemLogID | ( | ) |
Return an identification for the object for storage in the system log.
This id must be an integer.
Definition at line 1928 of file ElggEntity.php.
ElggEntity::getTags | ( | $tag_names = null | ) |
Returns tags for this entity.
array | $tag_names | Optionally restrict by tag metadata names. Defaults to metadata with the name 'tags'. |
Definition at line 1950 of file ElggEntity.php.
ElggEntity::getTimeUpdated | ( | ) |
Returns the UNIX epoch time that this entity was last updated.
Definition at line 1276 of file ElggEntity.php.
ElggEntity::getType | ( | ) |
Returns the entity type.
Definition at line 1192 of file ElggEntity.php.
ElggEntity::getURL | ( | ) |
Gets the URL for this entity.
Plugins can register for the 'entity:url', <type> plugin hook to customize the url for an entity.
Definition at line 1288 of file ElggEntity.php.
ElggEntity::getVolatileData | ( | $name | ) |
Get a piece of volatile (non-persisted) data on this entity.
string | $name | The name of the volatile data |
Definition at line 530 of file ElggEntity.php.
ElggEntity::hasAccess | ( | int | $user_guid = 0 | ) |
Check if the given user has access to this entity.
int | $user_guid | the GUID of the user to check access for (default: logged in user_guid) |
Definition at line 1084 of file ElggEntity.php.
ElggEntity::hasCapability | ( | string | $capability | ) |
Checks a specific capability is enabled for the entity type/subtype.
string | $capability | capability to check |
Definition at line 2153 of file ElggEntity.php.
ElggEntity::hasIcon | ( | $size, | |
$type = 'icon' |
|||
) |
Returns if the entity has an icon of the passed type.
string | $size | The size of the icon |
string | $type | The name of the icon. e.g., 'icon', 'cover_photo' |
Implements Elgg\EntityIcon.
Definition at line 1377 of file ElggEntity.php.
ElggEntity::hasRelationship | ( | int | $guid_two, |
string | $relationship | ||
) |
Check if this entity has a relationship with another entity.
Read the relationship like "This entity is a $relationship of $guid_two."
int | $guid_two | GUID of the target entity of the relationship |
string | $relationship | The type of relationship |
Definition at line 572 of file ElggEntity.php.
|
protected |
Initialize the attributes array.
This is vital to distinguish between metadata and base parameters.
Definition at line 157 of file ElggEntity.php.
ElggEntity::invalidateCache | ( | ) |
ElggEntity::isCacheable | ( | ) |
Is entity cacheable in the runtime cache.
Definition at line 2082 of file ElggEntity.php.
ElggEntity::isEnabled | ( | ) |
Is this entity enabled?
Definition at line 1817 of file ElggEntity.php.
|
protected |
Loads attributes from the entities table into the object.
stdClass | $row | Object of properties from database row(s) |
Definition at line 1639 of file ElggEntity.php.
|
protected |
Prepare an object copy for toObject()
\Elgg\Export\Entity | $object | Object representation of the entity |
Definition at line 1874 of file ElggEntity.php.
ElggEntity::removeAllPrivateSettings | ( | ) |
ElggEntity::removeAllRelatedRiverItems | ( | ) |
Removes all river items related to this entity.
Definition at line 776 of file ElggEntity.php.
ElggEntity::removeAllRelationships | ( | string | $relationship = null , |
bool | $inverse_relationship = false |
||
) |
Remove all relationships to or from this entity.
If you pass a relationship name, only relationships matching that name will be deleted.
string | null | $relationship | (optional) The name of the relationship to remove |
bool | $inverse_relationship | (optional) Inverse the relationship |
Definition at line 645 of file ElggEntity.php.
ElggEntity::removePrivateSetting | ( | $name | ) |
Removes private setting.
string | $name | Name of the private setting |
Definition at line 748 of file ElggEntity.php.
ElggEntity::removeRelationship | ( | $guid_two, | |
$relationship | |||
) |
Remove a relationship.
int | $guid_two | GUID of the target entity of the relationship |
string | $relationship | The type of relationship |
Definition at line 628 of file ElggEntity.php.
ElggEntity::save | ( | ) |
Definition at line 1399 of file ElggEntity.php.
Saves icons using a file located in the data store as the source.
string | $file | An ElggFile instance |
string | $type | The name of the icon. e.g., 'icon', 'cover_photo' |
array | $coords | An array of cropping coordinates x1, y1, x2, y2 |
Implements Elgg\EntityIcon.
Definition at line 1332 of file ElggEntity.php.
ElggEntity::saveIconFromLocalFile | ( | $filename, | |
$type = 'icon' , |
|||
array | $coords = [] |
||
) |
Saves icons using a local file as the source.
string | $filename | The full path to the local file |
string | $type | The name of the icon. e.g., 'icon', 'cover_photo' |
array | $coords | An array of cropping coordinates x1, y1, x2, y2 |
Implements Elgg\EntityIcon.
Definition at line 1320 of file ElggEntity.php.
ElggEntity::saveIconFromUploadedFile | ( | $input_name, | |
$type = 'icon' , |
|||
array | $coords = [] |
||
) |
Saves icons using an uploaded file as the source.
string | $input_name | Form input name |
string | $type | The name of the icon. e.g., 'icon', 'cover_photo' |
array | $coords | An array of cropping coordinates x1, y1, x2, y2 |
Implements Elgg\EntityIcon.
Definition at line 1308 of file ElggEntity.php.
ElggEntity::setContainerGUID | ( | $container_guid | ) |
Set the container for this object.
int | $container_guid | The ID of the container. |
Definition at line 1248 of file ElggEntity.php.
ElggEntity::setDisplayName | ( | $display_name | ) |
Sets the title or name of this entity.
string | $display_name | The title or name of this entity. |
Definition at line 328 of file ElggEntity.php.
ElggEntity::setLatLong | ( | float | $lat, |
float | $long | ||
) |
Set latitude and longitude metadata tags for a given entity.
float | $lat | Latitude |
float | $long | Longitude |
Definition at line 1895 of file ElggEntity.php.
ElggEntity::setMetadata | ( | $name, | |
$value, | |||
$value_type = '' , |
|||
$multiple = false |
|||
) |
Set metadata on this entity.
Plugin developers usually want to use the magic set method ($entity->name = 'value'). Use this method if you want to explicitly set the owner or access of the metadata. You cannot set the owner/access before the entity has been saved.
string | $name | Name of the metadata |
mixed | $value | Value of the metadata (doesn't support assoc arrays) |
string | $value_type | 'text', 'integer', or '' for automatic detection |
bool | $multiple | Allow multiple values for a single name. Does not support associative arrays. |
Definition at line 376 of file ElggEntity.php.
ElggEntity::setPrivateSetting | ( | $name, | |
$value | |||
) |
Adds a private setting to this entity.
string | $name | Name of private setting |
mixed | $value | Value of private setting |
Definition at line 682 of file ElggEntity.php.
ElggEntity::setSubtype | ( | string | $subtype | ) |
Set the subtype of the entity.
string | $subtype | the new type |
Definition at line 1205 of file ElggEntity.php.
|
protected |
Set temp metadata on this entity.
string | $name | Name of the metadata |
mixed | $value | Value of the metadata (doesn't support assoc arrays) |
bool | $multiple | Allow multiple values for a single name. Does not support associative arrays. |
Definition at line 463 of file ElggEntity.php.
ElggEntity::setVolatileData | ( | $name, | |
$value | |||
) |
Set a piece of volatile (non-persisted) data on this entity.
string | $name | Name |
mixed | $value | Value |
Definition at line 542 of file ElggEntity.php.
ElggEntity::toObject | ( | array | $params = [] | ) |
Export an entity.
array | $params | Params to pass to the hook |
Definition at line 1860 of file ElggEntity.php.
|
protected |
Update the entity in the database.
InvalidParameterException |
Definition at line 1578 of file ElggEntity.php.
ElggEntity::updateLastAction | ( | $posted = null | ) |
Update the last_action column in the entities table.
int | $posted | Timestamp of last action |
Definition at line 2044 of file ElggEntity.php.
|
protected |
Definition at line 125 of file ElggEntity.php.
|
protected |
Definition at line 113 of file ElggEntity.php.
|
protected |
Definition at line 108 of file ElggEntity.php.
|
protected |
Definition at line 88 of file ElggEntity.php.
|
protected |
Definition at line 81 of file ElggEntity.php.
|
protected |
Definition at line 95 of file ElggEntity.php.
|
protected |
Definition at line 102 of file ElggEntity.php.
|
protected |
Definition at line 66 of file ElggEntity.php.
const ElggEntity::PRIMARY_ATTR_NAMES |
Definition at line 50 of file ElggEntity.php.