31 parent::initializeAttributes();
33 $this->attributes[
'type'] =
"object";
34 $this->attributes += self::getExternalAttributes();
48 'description' => null,
75 $msg =
"Failed to load new " . get_class($this) .
" for GUID: " .
$row->guid;
76 throw new \IOException($msg);
78 }
else if (is_numeric(
$row)) {
82 throw new \IOException(
"Failed to load new " . get_class($this) .
" from GUID:" .
$row);
85 throw new \InvalidParameterException(
"Unrecognized value passed to constuctor.");
99 $attr_loader = new \Elgg\AttributeLoader(get_class(),
'object', $this->attributes);
100 $attr_loader->requires_access_control = !($this instanceof \ElggPlugin);
101 $attr_loader->secondary_loader =
'get_object_entity_as_row';
103 $attrs = $attr_loader->getRequiredAttributes(
$guid);
108 $this->attributes =
$attrs;
120 $guid = parent::create();
128 $query =
"INSERT INTO {$dbprefix}objects_entity 129 (guid, title, description) 131 (:guid, :title, :description)";
134 ':guid' => (int)
$guid,
154 if (!parent::update()) {
161 UPDATE {$dbprefix}objects_entity 163 description = :description 169 ':title' => (string) $this->
title,
187 $this->
title = $displayName;
212 return array_merge(parent::getExportableValues(), array(
static getExternalAttributes()
Get default values for attributes stored in a separate table.
$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.
getDatabase()
Provides a pointer to the database object.
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.
load($guid)
Loads the full when given a guid.
initializeAttributes()
Initialize the attributes array to include the type, title, and description.
$guid
Removes an admin notice.
elgg input elgg input elgg input tags
if(!$site) if(!($site instanceof ElggSite)) $site description
elgg_instanceof($entity, $type=null, $subtype=null, $class=null)
Checks if $entity is an and optionally for type and subtype.
canComment($user_guid=0, $default=null)
Can a user comment on this object?
if($categories) $description
elgg_deprecated_notice($msg, $dep_version, $backtrace_level=1)
Log a notice about deprecated use of a function, view, etc.
__construct($row=null)
Create a new .
_elgg_services(\Elgg\Di\ServiceProvider $services=null)
Get the global service provider.
setDisplayName($displayName)
{}
getContainerEntity()
Get the container entity for this object.
$user_guid
Avatar remove action.
getExportableValues()
Return an array of fields which can be exported.