class Comments in Instagram API 8
Class Comments.
@package Drupal\instagram_api\Service
Hierarchy
- class \Drupal\instagram_api\Service\Comments
Expanded class hierarchy of Comments
1 string reference to 'Comments'
1 service uses Comments
File
- src/
Service/ Comments.php, line 12
Namespace
Drupal\instagram_api\ServiceView source
class Comments {
/**
* Client.
*
* @var \Drupal\instagram_api\Service\Client
*/
protected $client;
/**
* Logger Factory.
*
* @var \Drupal\Core\Logger\LoggerChannelFactoryInterface
*/
protected $loggerFactory;
/**
* Media constructor.
*
* @param \Drupal\instagram_api\Service\Client $client
* Client.
* @param \Drupal\Core\Logger\LoggerChannelFactoryInterface $loggerFactory
* LoggerChannelFactory.
*/
public function __construct(Client $client, LoggerChannelFactoryInterface $loggerFactory) {
// Instagram API Client.
$this->client = $client;
$this->loggerFactory = $loggerFactory;
}
/**
* Get a list of recent comments on your media object.
*
* @param string $mediaId
* Media ID.
* @param bool $cacheable
* Cacheable.
*
* @return array|bool
* Response array.
* https://api.instagram.com/v1/media/{media-id}/comments?access_token=ACCESS-TOKEN
*
* @see https://www.instagram.com/developer/endpoints/media/
*/
public function getComments($mediaId, $cacheable = TRUE) {
$response = $this->client
->request('media/' . $mediaId . '/comments', [], $cacheable);
if ($response) {
return $response;
}
return FALSE;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Comments:: |
protected | property | Client. | |
Comments:: |
protected | property | Logger Factory. | |
Comments:: |
public | function | Get a list of recent comments on your media object. | |
Comments:: |
public | function | Media constructor. |