Elgg  Version 3.0
ElggComment.php
Go to the documentation of this file.
1 <?php
9 class ElggComment extends \ElggObject {
10 
16  protected function initializeAttributes() {
17  parent::initializeAttributes();
18 
19  $this->attributes['subtype'] = "comment";
20  }
21 
33  public function canComment($user_guid = 0, $default = false) {
34  return false;
35  }
36 
43  public function save($update_last_action = true) {
44  $result = parent::save();
45  if ($result && $update_last_action) {
46  $container = $this->getContainerEntity();
47  if ($container) {
48  $container->updateLastAction($this->time_updated);
49  }
50  }
51  return $result;
52  }
53 }
$user_guid
Validate a user.
Definition: validate.php:6
$container
Definition: delete.php:23
initializeAttributes()
Set subtype to comment.
Definition: ElggComment.php:16
$default
Definition: checkbox.php:35
canComment($user_guid=0, $default=false)
Can a user comment on this object? Always returns false (threaded comments not yet supported) ...
Definition: ElggComment.php:33
save($update_last_action=true)
Update container entity last action on successful save.
Definition: ElggComment.php:43
getContainerEntity()
Get the container entity for this object.