Elgg  Version 6.0
DatabaseRecord.php
Go to the documentation of this file.
1 <?php
2 
4 
6 
20 
24  protected $row;
25 
31  public function __construct(\stdClass $row) {
32  $this->row = $row;
33  }
34 
42  public function __get($name) {
43 
44  switch ($name) {
45  case 'id':
46  case 'recipient_guid':
47  case 'timestamp':
48  return (int) $this->row->$name;
49 
50  case 'delivery_interval':
51  return $this->row->$name;
52 
53  case 'data':
54  return unserialize($this->row->data);
55  }
56 
57  return null;
58  }
59 
65  public function delete(): bool {
66  return (bool) _elgg_services()->delayedEmailQueueTable->deleteRow($this->id);
67  }
68 
74  public function getNotification(): ?Notification {
75  return $this->data instanceof Notification ? $this->data : null;
76  }
77 }
if(!$user||!$user->canDelete()) $name
Definition: delete.php:22
__get($name)
Get a row property.
Notification container.
getNotification()
Get the notification for this record.
__construct(\stdClass $row)
Create a new record.
_elgg_services()
Get the global service provider.
Definition: elgglib.php:351