51 if (!in_array(
$key, static::PRIMARY_ATTR_NAMES)) {
56 if (in_array(
$key, static::INTEGER_ATTR_NAMES)) {
69 parent::initializeAttributes();
71 $this->attributes[
'id'] = null;
72 $this->attributes[
'guid_one'] = null;
73 $this->attributes[
'relationship'] = null;
74 $this->attributes[
'guid_two'] = null;
86 if (in_array($name, static::INTEGER_ATTR_NAMES) && isset($value) && !is_int($value)) {
88 $value = (int) $value;
91 if ($this->$name === $value) {
96 if (!array_key_exists($name, $this->attributes)) {
101 if (in_array($name, [
'id',
'time_created'])) {
106 if ($this->
id > 0 && !array_key_exists($name, $this->orig_attributes)) {
108 $this->orig_attributes[
$name] = $this->attributes[
$name];
122 if (array_key_exists($name, $this->attributes)) {
123 return $this->attributes[
$name];
133 if ($this->
id > 0 && empty($this->orig_attributes)) {
147 $this->attributes[
'id'] =
$id;
148 $this->attributes[
'time_created'] =
_elgg_services()->relationshipsTable->getCurrentTime()->getTimestamp();
158 public function delete():
bool {
180 $object = new \Elgg\Export\Relationship();
182 $object->subject_guid = $this->guid_one;
184 $object->object_guid = $this->guid_two;
187 $params[
'relationship'] = $this;
220 return 'relationship';
toObject(array $params=[])
{}
__set(string $name, mixed $value)
Set an attribute of the relationship.
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.
c Accompany it with the information you received as to the offer to distribute corresponding source complete source code means all the source code for all modules it plus any associated interface definition plus the scripts used to control compilation and installation of the executable as a special the source code distributed need not include anything that is normally and so on of the operating system on which the executable unless that component itself accompanies the executable If distribution of executable or object code is made by offering access to copy from a designated then offering equivalent access to copy the source code from the same place counts as distribution of the source even though third parties are not compelled to copy the source along with the object code You may not or distribute the Program except as expressly provided under this License Any attempt otherwise to sublicense or distribute the Program is void
$relationship
Elgg default relationship view.
getType()
Return a type of the object - eg.
getOriginalAttributes()
Get the original values of attribute(s) that have been modified since the relationship was persisted...
__get(string $name)
Get an attribute of the relationship.
A generic class that contains shared code among , , and .
__construct(\stdClass $row=null)
Create a relationship object.
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.
getURL()
Get a URL for this relationship.
getSubtype()
Return a subtype.