| Total Complexity | 3 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class FormCommentModerate extends Model |
||
| 10 | { |
||
| 11 | private $_records; |
||
| 12 | private $_type; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * FormCommentModerate constructor. Pass active record and type of comment system inside. |
||
| 16 | * @param CommentPost|CommentAnswer $records |
||
| 17 | * @param string $type |
||
| 18 | */ |
||
| 19 | public function __construct($records, $type) |
||
| 20 | { |
||
| 21 | $this->_records = $records; |
||
| 22 | $this->_type = $type; |
||
| 23 | parent::__construct(); |
||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Accept comments and answers |
||
| 28 | */ |
||
| 29 | public function make() |
||
| 30 | { |
||
| 31 | $this->_records->update(['moderate' => 0]); |
||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Get moderated records |
||
| 36 | * @return object |
||
| 37 | */ |
||
| 38 | public function getRecord() |
||
| 41 | } |
||
| 42 | } |
||
| 43 |