You are here

protected function FileLinkItem::isSupportedResponse in File Link 8

Same name and namespace in other branches
  1. 2.0.x src/Plugin/Field/FieldType/FileLinkItem.php \Drupal\file_link\Plugin\Field\FieldType\FileLinkItem::isSupportedResponse()

Check whereas given response is supported by field type.

Parameters

\Psr\Http\Message\ResponseInterface $response: Response object.

Return value

bool TRUE if supported, FALSE otherwise.

1 call to FileLinkItem::isSupportedResponse()
FileLinkItem::preSave in src/Plugin/Field/FieldType/FileLinkItem.php
Defines custom presave behavior for field values.

File

src/Plugin/Field/FieldType/FileLinkItem.php, line 318

Class

FileLinkItem
Implements a 'file_link' plugin field type.

Namespace

Drupal\file_link\Plugin\Field\FieldType

Code

protected function isSupportedResponse(ResponseInterface $response) {
  return in_array($response
    ->getStatusCode(), [
    '200',
    '301',
    '302',
  ]);
}