31 parent::initializeAttributes();
33 $this->attributes[
'type'] =
"object";
34 $this->attributes[
'title'] = null;
35 $this->attributes[
'description'] = null;
36 $this->tables_split = 2;
62 if (
$row instanceof stdClass) {
65 $msg =
"Failed to load new " . get_class() .
" for GUID: " .
$row->guid;
70 elgg_deprecated_notice(
'This type of usage of the ElggObject constructor was deprecated. Please use the clone method.', 1.7);
74 }
else if (is_numeric(
$row)) {
78 throw new IOException(
"Failed to load new " . get_class() .
" from GUID:" .
$row);
96 $attr_loader->requires_access_control = !($this instanceof
ElggPlugin);
97 $attr_loader->secondary_loader =
'get_object_entity_as_row';
99 $attrs = $attr_loader->getRequiredAttributes(
$guid);
104 $this->attributes =
$attrs;
105 $this->tables_loaded = 2;
118 $guid = parent::create();
127 $query =
"INSERT into {$CONFIG->dbprefix}objects_entity 128 (guid, title, description) values ($guid, '$title', '$description')";
145 if (!parent::update()) {
149 $guid = (int)$this->guid;
153 $query =
"UPDATE {$CONFIG->dbprefix}objects_entity 154 set title='$title', description='$description' where guid=$guid";
156 return $this->
getDatabase()->updateData($query) !==
false;
170 $this->
title = $displayName;
192 return parent::getSites();
203 if (is_numeric(
$site)) {
208 return parent::addToSite(
$site);
233 return array_merge(parent::getExportableValues(), array(
addToSite($site)
Add this object to a site.
getDatabase()
Provides a pointer to the database object.
get_site_objects($site_guid, $subtype="", $limit=10, $offset=0)
Get the objects belonging to a site.
loadAdditionalSelectValues(array $data)
Stores non-attributes from the loading of the entity as volatile data.
canWriteToContainer($user_guid=0, $type= 'all', $subtype= 'all')
Can a user add an entity to this container.
getSites($options="", $limit=10, $offset=0)
Return sites that this object is a member of.
load($guid)
Loads the full ElggObject when given a guid.
add_site_object($site_guid, $object_guid)
Add an object to a site.
if($screenshots) $description
getGUID()
Returns the guid.
initializeAttributes()
Initialize the attributes array to include the type, title, and description.
$guid
Removes an admin notice.
elgg input elgg input tags
sanitize_string($string)
Sanitize a string for database use.
elgg_instanceof($entity, $type=null, $subtype=null, $class=null)
Checks if $entity is an ElggEntity and optionally for type and subtype.
initialise_attributes($pre18_api=true)
Initialise the attributes array.
elgg_deprecated_notice($msg, $dep_version, $backtrace_level=1)
Sends a notice about deprecated use of a function, view, etc.
elgg global
Pointer to the global context.
__construct($row=null)
Create a new ElggObject.
setDisplayName($displayName)
{}
canComment($user_guid=0)
Can a user comment on this object?
getContainerEntity()
Get the container entity for this object.
$user_guid
Avatar remove action.
getExportableValues()
Return an array of fields which can be exported.
_elgg_cache_entity(ElggEntity $entity)
Cache an entity.
elgg_get_logged_in_user_guid()
Return the current logged in user by guid.