Elgg  Version 6.2
Public Member Functions | Protected Member Functions | List of all members
ElggSite Class Reference
Inheritance diagram for ElggSite:
ElggEntity ElggData Elgg\Collections\CollectionItemInterface

Public Member Functions

 save ()
 {Save this data to the appropriate database table.
Returns
bool
} More...
 
 delete (bool $recursive=true, ?bool $persistent=null)
 {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.
Warning
If deleting recursively, this bypasses ownership of items contained by the entity. That means that if the container_guid = $this->guid, the item will be deleted regardless of who owns it.
Parameters
bool$recursiveIf true (default) then all entities which are owned or contained by $this will also be deleted.
bool | null$persistentpersistently delete the entity (default: check the 'restorable' capability)
Returns
bool
} More...
 
 disable (string $reason='', bool $recursive=true)
 Disable the site. More...
 
 __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.
Parameters
string$nameName of the attribute or metadata
mixed$valueThe value to be set
Returns
void
Exceptions
} More...
 
 __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.
Parameters
string$nameName of the attribute or metadata
Returns
mixed
} More...
 
 getURL ()
 Returns the URL for this site. More...
 
 isCacheable ()
 {Is entity cacheable in the runtime cache.
Returns
bool
} More...
 
 getDomain ()
 Get the domain for this site. More...
 
 getEmailAddress ()
 Get the email address for the site. More...
 
 updateLastAction (?int $posted=null)
 {Update the last_action column in the entities table.
Warning
This is different to time_updated. Time_updated is automatically set, while last_action is only set when explicitly called.
Parameters
null | int$postedTimestamp of last action
Returns
int
} More...
 
- Public Member Functions inherited from ElggEntity
 __construct (?\stdClass $row=null)
 Create a new entity. More...
 
 __clone ()
 Clone an entity. More...
 
 getOriginalAttributes ()
 Get the original values of attribute(s) that have been modified since the entity was persisted. More...
 
 getDisplayName ()
 Get the entity's display name. More...
 
 setDisplayName (string $display_name)
 Sets the title or name of this entity. More...
 
 getVolatileData (string $name)
 Get a piece of volatile (non-persisted) data on this entity. More...
 
 setVolatileData (string $name, $value)
 Set a piece of volatile (non-persisted) data on this entity. More...
 
 removeAllRelatedRiverItems ()
 Removes all river items related to this entity. More...
 
 countComments ()
 Count the number of comments attached to this entity. More...
 
 hasAccess (int $user_guid=0)
 Check if the given user has access to this entity. More...
 
 canEdit (int $user_guid=0)
 Can a user edit this entity? More...
 
 canDelete (int $user_guid=0)
 Can a user delete this entity? More...
 
 canWriteToContainer (int $user_guid=0, string $type='', string $subtype='')
 Can a user add an entity to this container. More...
 
 canComment (int $user_guid=0)
 Can a user comment on an entity? More...
 
 canAnnotate (int $user_guid=0, string $annotation_name='')
 Can a user annotate an entity? 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 \ElggEntity that owns this entity. More...
 
 setContainerGUID (int $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...
 
 enable (bool $recursive=true)
 Enable the entity. More...
 
 isEnabled ()
 Is this entity enabled? More...
 
 restore (bool $recursive=true)
 Restore the entity. More...
 
 isDeleted ()
 Is the entity marked as deleted. 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.This id must be an integer. Unsaved implementations should return 0.
Returns
int
} More...
 
 getObjectFromID (int $id)
 For a given ID, return the object associated with it. More...
 
 updateTimeDeleted (?int $deleted=null)
 Update the time_deleted column in the entities table. More...
 
 disableCaching ()
 Disable runtime caching for entity. More...
 
 enableCaching ()
 Enable runtime caching for entity. More...
 
 cache ()
 Cache the entity in a session cache. More...
 
 invalidateCache ()
 Invalidate cache for entity. More...
 
 hasCapability (string $capability)
 Checks a specific capability is enabled for the entity type/subtype. More...
 
 getFields ()
 Helper function to easily retrieve form fields for this entity. More...
 
- Public Member Functions inherited from ElggData
 __isset ($name)
 Test if property is set either as an attribute or metadata. More...
 
 __unset ($name)
 Unset a property from metadata or attribute. More...
 
 delete ()
 Delete this data. More...
 
 getTimeCreated ()
 Returns the UNIX epoch time that this entity was created. More...
 
 rewind ()
 Iterator interface. More...
 
 current ()
 Iterator interface. More...
 
 key ()
 Iterator interface. More...
 
 next ()
 Iterator interface. More...
 
 valid ()
 Iterator interface. More...
 
 offsetSet ($offset, $value)
 Array access interface. More...
 
 offsetGet ($offset)
 Array access interface. More...
 
 offsetUnset ($offset)
 Array access interface. More...
 
 offsetExists ($offset)
 Array access interface. More...
 
 getID ()
 {Get unique item identifier within a collection.
Returns
string|int
} More...
 
 getPriority ()
 {Get priority (weight) of the item within a collection.
Returns
int
} More...
 
 __serialize ()
 Called during serialization. More...
 
 __unserialize (array $data)
 Called during unserialization. More...
 

Protected Member Functions

 initializeAttributes ()
 {Initialize the attributes array.This is vital to distinguish between metadata and base parameters.
Returns
void
} More...
 
 prepareObject (\Elgg\Export\Entity $object)
 {Prepare an object copy for toObject()
Parameters
\Elgg\Export\Entity$objectObject representation of the entity
Returns
\Elgg\Export\Entity
} More...
 
- Protected Member Functions inherited from ElggEntity
 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...
 
 persistentDelete (bool $recursive=true)
 Permanently delete the entity from the database. More...
 
 trash (bool $recursive=true)
 Move the entity to the trash. More...
 
- Protected Member Functions inherited from ElggData
 getDatabase ()
 Provides a pointer to the database object. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ElggEntity
static getDefaultFields ()
 Returns a default set of fields to be used for forms related to this entity. More...
 
- Public Attributes inherited from ElggEntity
const PRIMARY_ATTR_NAMES
 
- Protected Attributes inherited from ElggEntity
const INTEGER_ATTR_NAMES
 
 $volatile = []
 
 $orig_attributes = []
 
 $_is_cacheable = true
 
- Protected Attributes inherited from ElggData
 $attributes = []
 
 $valid = false
 

Detailed Description

Definition at line 28 of file ElggSite.php.

Member Function Documentation

◆ __get()

ElggSite::__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.

Parameters
string$nameName of the attribute or metadata
Returns
mixed
}

Reimplemented from ElggEntity.

Definition at line 112 of file ElggSite.php.

◆ __set()

ElggSite::__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.

Parameters
string$nameName of the attribute or metadata
mixed$valueThe value to be set
Returns
void
Exceptions
}

Reimplemented from ElggEntity.

Definition at line 100 of file ElggSite.php.

◆ delete()

ElggSite::delete ( bool  $recursive = true,
?bool  $persistent = null 
)

{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.

Warning
If deleting recursively, this bypasses ownership of items contained by the entity. That means that if the container_guid = $this->guid, the item will be deleted regardless of who owns it.
Parameters
bool$recursiveIf true (default) then all entities which are owned or contained by $this will also be deleted.
bool | null$persistentpersistently delete the entity (default: check the 'restorable' capability)
Returns
bool
}

Reimplemented from ElggEntity.

Definition at line 70 of file ElggSite.php.

◆ disable()

ElggSite::disable ( string  $reason = '',
bool  $recursive = true 
)

Disable the site.

Note
You cannot disable the current site.
Parameters
string$reasonOptional reason for disabling
bool$recursiveRecursively disable all contained entities?
Returns
bool
Exceptions
SecurityException

Reimplemented from ElggEntity.

Definition at line 89 of file ElggSite.php.

◆ getDomain()

ElggSite::getDomain ( )

Get the domain for this site.

Returns
string
Since
1.9

Definition at line 153 of file ElggSite.php.

◆ getEmailAddress()

ElggSite::getEmailAddress ( )

Get the email address for the site.

This can be set in the basic site settings or fallback to noreply@domain

Returns
string
Since
3.0.0

Definition at line 166 of file ElggSite.php.

◆ getURL()

ElggSite::getURL ( )

Returns the URL for this site.

Returns
string The URL

Reimplemented from ElggEntity.

Definition at line 125 of file ElggSite.php.

◆ initializeAttributes()

ElggSite::initializeAttributes ( )
protected

{Initialize the attributes array.This is vital to distinguish between metadata and base parameters.

Returns
void
}

Reimplemented from ElggEntity.

Definition at line 33 of file ElggSite.php.

◆ isCacheable()

ElggSite::isCacheable ( )

{Is entity cacheable in the runtime cache.

Returns
bool
}

Reimplemented from ElggEntity.

Definition at line 132 of file ElggSite.php.

◆ prepareObject()

ElggSite::prepareObject ( \Elgg\Export\Entity  $object)
protected

{Prepare an object copy for toObject()

Parameters
\Elgg\Export\Entity$objectObject representation of the entity
Returns
\Elgg\Export\Entity
}

Reimplemented from ElggEntity.

Definition at line 139 of file ElggSite.php.

◆ save()

ElggSite::save ( )

{Save this data to the appropriate database table.

Returns
bool
}

Reimplemented from ElggEntity.

Definition at line 48 of file ElggSite.php.

◆ updateLastAction()

ElggSite::updateLastAction ( ?int  $posted = null)

{Update the last_action column in the entities table.

Warning
This is different to time_updated. Time_updated is automatically set, while last_action is only set when explicitly called.
Parameters
null | int$postedTimestamp of last action
Returns
int
}

Reimplemented from ElggEntity.

Definition at line 180 of file ElggSite.php.


The documentation for this class was generated from the following file: