You are here

FileLinkInterface.php in File Link 8

Same filename and directory in other branches
  1. 2.0.x src/FileLinkInterface.php

Namespace

Drupal\file_link

File

src/FileLinkInterface.php
View source
<?php

namespace Drupal\file_link;

use GuzzleHttp\Exception\RequestException;
use Psr\Http\Message\ResponseInterface;

/**
 * Provides an interface for File Link field.
 */
interface FileLinkInterface {

  /**
   * Get raw file size.
   *
   * @return int
   *   File size in bytes.
   */
  public function getSize();

  /**
   * Get file format.
   *
   * @return string
   *   File format.
   */
  public function getFormat();

  /**
   * Sets the latest HTTP response.
   *
   * @param \Psr\Http\Message\ResponseInterface $response
   *   The last response to be stored.
   *
   * @return $this
   */
  public function setResponse(ResponseInterface $response);

  /**
   * Gets the latest stored HTTP response.
   *
   * @return \Psr\Http\Message\ResponseInterface
   *   A response object.
   */
  public function getResponse();

  /**
   * Clears a previous stored HTTP response.
   *
   * @return $this
   */
  public function clearResponse();

  /**
   * Sets the exception throw by the last HTTP client request.
   *
   * @param \GuzzleHttp\Exception\RequestException $exception
   *   The last Guzzle request exception.
   *
   * @return $this
   */
  public function setException(RequestException $exception);

  /**
   * Gets the last Guzzle client exception.
   *
   * @return \GuzzleHttp\Exception\RequestException
   *   The last Guzzle client exception.
   */
  public function getException();

  /**
   * Clears a previous stored Guzzle exception.
   *
   * @return $this
   */
  public function clearException();

}

Interfaces

Namesort descending Description
FileLinkInterface Provides an interface for File Link field.