isPost()) { throw new BadRequest(); } if (empty($data->id)) { throw new BadRequest(); } if (empty($data->link)) { throw new BadRequest(); } return $this->getRecordService()->unlinkAll($data->id, $data->link); } public function postActionOptOut($params, $data) { if (empty($data->id)) { throw new BadRequest(); } if (empty($data->targetType)) { throw new BadRequest(); } if (empty($data->targetId)) { throw new BadRequest(); } $data->id = strval($data->id); $data->targetId = strval($data->targetId); return $this->getRecordService()->optOut($data->id, $data->targetType, $data->targetId); } public function postActionCancelOptOut($params, $data) { if (empty($data->id)) { throw new BadRequest(); } if (empty($data->targetType)) { throw new BadRequest(); } if (empty($data->targetId)) { throw new BadRequest(); } $data->id = strval($data->id); $data->targetId = strval($data->targetId); return $this->getRecordService()->cancelOptOut($data->id, $data->targetType, $data->targetId); } }