示例#1
0
 public function removeFromBlacklist()
 {
     $required = array('blocked_user_id' => true);
     $blacklist = \Blacklist::model()->findByAttributes(array('user_id' => $this->controller->identity->getId(), 'blocked_user_id' => $this->controller->getParams($required)['blocked_user_id']));
     if (!$blacklist) {
         throw new NotFoundApiException('UserNotFoundInBlacklist');
     }
     $blacklist->delete();
     $this->controller->setMessage('Success');
 }