Conditions | 3 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
59 | public function save() |
||
60 | { |
||
61 | // check if target is myself or always exist in block list |
||
62 | if ($this->_user->getId() === (int)$this->id || Blacklist::have($this->_user->getId(), $this->id)) { |
||
63 | return false; |
||
64 | } |
||
65 | |||
66 | // save data to db |
||
67 | $record = new Blacklist(); |
||
68 | $record->user_id = $this->_user->getId(); |
||
69 | $record->target_id = $this->id; |
||
70 | $record->comment = $this->comment; |
||
71 | $record->save(); |
||
72 | |||
73 | return true; |
||
74 | } |
||
76 |