You are here

function blogapi_metaweblog_decode_comment_code in Blog API 8

Helper function to convert metaWeblog comment codes to Drupal comment codes.

Parameters

$comment: The comment code.

Return value

int BlogAPI response.

2 calls to blogapi_metaweblog_decode_comment_code()
blogapi_metaweblog_edit_post in modules/blogapi_metaweblog/blogapi_metaweblog.module
Callback for metaWeblog.editPost.
blogapi_metaweblog_new_post in modules/blogapi_metaweblog/blogapi_metaweblog.module
Callback for metaWeblog.newPost.

File

modules/blogapi_metaweblog/blogapi_metaweblog.module, line 145
Module file for blogapi_blogger.

Code

function blogapi_metaweblog_decode_comment_code($comment) {
  switch ($comment) {
    case 0:
      return CommentItemInterface::HIDDEN;
    case 1:
      return CommentItemInterface::OPEN;
    case 2:
      return CommentItemInterface::CLOSED;
    default:
      return CommentItemInterface::CLOSED;
  }
}