class EntityNotFoundException in Salesforce Suite 8.4
Same name and namespace in other branches
- 8.3 src/EntityNotFoundException.php \Drupal\salesforce\EntityNotFoundException
- 5.0.x src/EntityNotFoundException.php \Drupal\salesforce\EntityNotFoundException
EntityNotFoundException extends Drupal\salesforce\Exception.
Thrown when a mapped entity cannot be loaded.
Hierarchy
- class \Drupal\salesforce\EntityNotFoundException extends \Drupal\salesforce\RuntimeException uses StringTranslationTrait
Expanded class hierarchy of EntityNotFoundException
3 files declare their use of EntityNotFoundException
- PushQueue.php in modules/
salesforce_push/ src/ PushQueue.php - Rest.php in modules/
salesforce_push/ src/ Plugin/ SalesforcePushQueueProcessor/ Rest.php - SalesforcePushQueueProcessorRestTest.php in modules/
salesforce_push/ tests/ src/ Unit/ SalesforcePushQueueProcessorRestTest.php
File
- src/
EntityNotFoundException.php, line 14
Namespace
Drupal\salesforceView source
class EntityNotFoundException extends \RuntimeException {
use StringTranslationTrait;
/**
* A list of entity properties, for logging.
*
* @var mixed
*/
protected $entityProperties;
/**
* Entity type id, for logging.
*
* @var string
*/
protected $entityTypeId;
/**
* EntityNotFoundException constructor.
*
* @param mixed $entityProperties
* Entity properties.
* @param string $entityTypeId
* Entity type id.
* @param \Throwable|null $previous
* Previous exception.
*/
public function __construct($entityProperties, $entityTypeId, Throwable $previous = NULL) {
parent::__construct($this
->t('Entity not found. type: %type properties: %props', [
'%type' => $entityTypeId,
'%props' => var_export($entityProperties, TRUE),
]), 0, $previous);
$this->entityProperties = $entityProperties;
$this->entityTypeId = $entityTypeId;
}
/**
* Getter.
*
* @return mixed
* The entityProperties.
*/
public function getEntityProperties() {
return $this->entityProperties;
}
/**
* Getter.
*
* @return string
* The entityTypeId.
*/
public function getEntityTypeId() {
return $this->entityTypeId;
}
/**
* Get a formattable message.
*
* @return \Drupal\Component\Render\FormattableMarkup
* The message.
*/
public function getFormattableMessage() {
return new FormattableMarkup('Entity not found. type: %type properties: %props', [
'%type' => $this->entityTypeId,
'%props' => var_export($this->entityProperties, TRUE),
]);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EntityNotFoundException:: |
protected | property | A list of entity properties, for logging. | |
EntityNotFoundException:: |
protected | property | Entity type id, for logging. | |
EntityNotFoundException:: |
public | function | Getter. | |
EntityNotFoundException:: |
public | function | Getter. | |
EntityNotFoundException:: |
public | function | Get a formattable message. | |
EntityNotFoundException:: |
public | function | EntityNotFoundException constructor. | |
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |