50 if (!in_array(
$key, static::PRIMARY_ATTR_NAMES)) {
55 if (in_array(
$key, static::INTEGER_ATTR_NAMES)) {
71 parent::initializeAttributes();
73 $this->attributes[
'id'] = null;
74 $this->attributes[
'guid_one'] = null;
75 $this->attributes[
'relationship'] = null;
76 $this->attributes[
'guid_two'] = null;
87 if (in_array(
$name, static::INTEGER_ATTR_NAMES) && isset(
$value) && !is_int(
$value)) {
97 if (!array_key_exists(
$name, $this->attributes)) {
102 if (in_array(
$name, [
'id',
'time_created'])) {
107 if ($this->
id > 0 && !array_key_exists(
$name, $this->orig_attributes)) {
109 $this->orig_attributes[
$name] = $this->attributes[
$name];
122 if (array_key_exists(
$name, $this->attributes)) {
123 return $this->attributes[
$name];
133 if (empty($this->orig_attributes)) {
153 $this->attributes[
'id'] =
$id;
163 public function delete():
bool {
185 $object = new \Elgg\Export\Relationship();
187 $object->subject_guid = $this->guid_one;
189 $object->object_guid = $this->guid_two;
192 $params[
'relationship'] = $this;
225 return 'relationship';
toObject(array $params=[])
{}
getTimeCreated()
Returns the UNIX epoch time that this entity was created.
$params
Saves global plugin settings.
if(!$user||!$user->canDelete()) $name
getObjectFromID(int $id)
For a given ID, return the object associated with it.
__set($name, $value)
Set an attribute of the relationship.
$relationship
Elgg default relationship view.
__get($name)
Get an attribute of the relationship.
getType()
Return a type of the object - eg.
initializeAttributes()
(non-PHPdoc)
getOriginalAttributes()
Get the original values of attribute(s) that have been modified since the relationship was persisted...
A generic class that contains shared code among , , and .
if($container instanceof ElggGroup &&$container->guid!=elgg_get_page_owner_guid()) $key
if($email instanceof\Elgg\Email) $object
foreach($plugin_guids as $guid) if(empty($deactivated_plugins)) $url
_elgg_services()
Get the global service provider.
elgg_normalize_url(string $url)
$id
Generic annotation delete action.
__construct(\stdClass $row)
Create a relationship object.
getURL()
Get a URL for this relationship.
getSubtype()
Return a subtype.