public function renderAddComment(AddCommentCommand $command)
 {
     $object = $command->getObject();
     if ($command->getObject()->getType() === $command::TYPE_HOST) {
         /** @var \Icinga\Module\Monitoring\Object\Host $object */
         $commandString = sprintf('ADD_HOST_COMMENT;%s', $object->getName());
     } else {
         /** @var \Icinga\Module\Monitoring\Object\Service $object */
         $commandString = sprintf('ADD_SVC_COMMENT;%s;%s', $object->getHost()->getName(), $object->getName());
     }
     return sprintf('%s;%u;%s;%s', $commandString, $command->getPersistent(), $command->getAuthor(), $command->getComment());
 }
 public function renderAddComment(AddCommentCommand $command)
 {
     $endpoint = 'actions/add-comment';
     $data = array('author' => $command->getAuthor(), 'comment' => $command->getComment());
     $this->applyFilter($data, $command->getObject());
     return IcingaApiCommand::create($endpoint, $data);
 }