You are here

private function FacebookFeedBlock::getSettings in Facebook Feed Block 8

Fetches a list of page posts using Facebook's Graph API.

Return value

array An array of objects containing post data.

1 call to FacebookFeedBlock::getSettings()
FacebookFeedBlock::getPosts in src/Plugin/Block/FacebookFeedBlock.php
Fetches a list of page posts using Facebook's Graph API.

File

src/Plugin/Block/FacebookFeedBlock.php, line 151

Class

FacebookFeedBlock
Provides a 'FacebookFeedBlock' block.

Namespace

Drupal\facebook_feed\Plugin\Block

Code

private function getSettings() {
  $postFields = [
    'id',
    'created_time',
    'message',
    'picture',
    'link',
    'comments.summary(true)',
    'reactions.summary(true)',
    'likes.summary(true)',
    'shares',
  ];
  $settings = [
    'page_id' => $this->configuration['page_id'],
    'feedType' => 'feed',
    'limit' => $this->configuration['limit'],
    'access_token' => $this
      ->getAccessToken(),
    'fields' => implode(',', $postFields),
  ];
  return $settings;
}