You are here

public function HttpServiceApiWrapperPosts::findComments in HTTP Client Manager 8.2

Find Comments.

Parameters

null|int $postId: The Post id from which extract the related Comments.

Return value

array An array of Comments related to the given Post.

File

modules/http_client_manager_example/src/Plugin/HttpServiceApiWrapper/HttpServiceApiWrapperPosts.php, line 77

Class

HttpServiceApiWrapperPosts
Class HttpServiceApiWrapperPosts.

Namespace

Drupal\http_client_manager_example\Plugin\HttpServiceApiWrapper

Code

public function findComments($postId = NULL) {
  $args = is_null($postId) ? [] : [
    'postId' => (int) $postId,
  ];
  return $this
    ->call(Posts::FIND_COMMENTS, $args)
    ->toArray();
}