You are here

class InaccessibleRecordException in RESTful 7.2

Class InaccessibleRecordException.

@package Drupal\restful\Exception

Hierarchy

Expanded class hierarchy of InaccessibleRecordException

8 files declare their use of InaccessibleRecordException
CacheDecoratedDataProvider.php in src/Plugin/resource/DataProvider/CacheDecoratedDataProvider.php
Contains \Drupal\restful\Plugin\resource\DataProvider\CacheDecoratedDataProvider.
DataProviderEntity.php in src/Plugin/resource/DataProvider/DataProviderEntity.php
Contains \Drupal\restful\Plugin\resource\DataProvider\DataProviderEntity.
DataProviderPlug.php in src/Plugin/resource/DataProvider/DataProviderPlug.php
Contains \Drupal\restful\Plugin\resource\DataProvider\DataProviderPlug.
DataProviderVariable.php in modules/restful_example/src/Plugin/resource/variables/DataProviderVariable.php
Contains \Drupal\restful_example\Plugin\resource\variables\DataProviderVariable.
FormatterJsonApi.php in src/Plugin/formatter/FormatterJsonApi.php
Contains \Drupal\restful\Plugin\formatter\FormatterJsonApi.

... See full list

File

src/Exception/InaccessibleRecordException.php, line 15
Contains \Drupal\restful\Exception\InaccessibleRecordException.

Namespace

Drupal\restful\Exception
View source
class InaccessibleRecordException extends RestfulException {
  const ERROR_404_MESSAGE = 'Page not found.';

  /**
   * Instantiates a InaccessibleRecordException object.
   *
   * @param string $message
   *   The exception message.
   */
  public function __construct($message) {
    $show_access_denied = variable_get('restful_show_access_denied', FALSE);
    $this->message = $show_access_denied ? $message : static::ERROR_404_MESSAGE;
    $this->code = $show_access_denied ? 403 : 404;
    $this->instance = $show_access_denied ? 'help/restful/problem-instances-forbidden' : 'help/restful/problem-instances-not-found';
  }

}

Members

Namesort descending Modifiers Type Description Overrides
InaccessibleRecordException::ERROR_404_MESSAGE constant
InaccessibleRecordException::__construct public function Instantiates a InaccessibleRecordException object.
RestfulException::$description protected property Exception description. 4
RestfulException::$fieldErrors protected property Array keyed by the field name, and array of error messages as value.
RestfulException::$headers protected property Array of extra headers to set when throwing an exception.
RestfulException::$instance protected property Defines the instance resource. 13
RestfulException::addFieldError public function Add an error per field.
RestfulException::getDescription final public function Gets the description of the exception.
RestfulException::getFieldErrors public function Return an array with all the errors.
RestfulException::getHeaders public function Get the associative array of headers.
RestfulException::getInstance public function Get the URL to the error for the particular case.
RestfulException::getType public function Return a string to the common problem type.
RestfulException::setHeader public function Set a header.