-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfeature.class.php
More file actions
30 lines (24 loc) · 885 Bytes
/
feature.class.php
File metadata and controls
30 lines (24 loc) · 885 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
class QuipCommentFeatureProcessor extends xPDOSimpleObject {
public $classKey = 'quipComment';
public $permission = '';
public $languageTopics = array('quip:default');
/** @var quipComment $comment */
public $comment;
public function initialize() {
$id = $this->getProperty('id');
if (empty($id)) return $this->modx->lexicon('quip.comment_err_ns');
$this->comment = $this->modx->getObject($this->classKey,$id);
if (empty($this->comment)) return $this->modx->lexicon('quip.comment_err_nf');
return parent::initialize();
}
public function process(array $options = array()) {
$this->set('helpful',true);
/* first attempt to save/approve */
if ($this->save() === false) {
return false;
}
return true;
}
}
return 'QuipCommentFeatureProcessor';