protected function LingotekContentEntityStorageException::extractTableFromPreviousExceptionMessage in Lingotek Translation 3.2.x
Same name and namespace in other branches
- 8 src/Exception/LingotekContentEntityStorageException.php \Drupal\lingotek\Exception\LingotekContentEntityStorageException::extractTableFromPreviousExceptionMessage()
- 8.2 src/Exception/LingotekContentEntityStorageException.php \Drupal\lingotek\Exception\LingotekContentEntityStorageException::extractTableFromPreviousExceptionMessage()
- 4.0.x src/Exception/LingotekContentEntityStorageException.php \Drupal\lingotek\Exception\LingotekContentEntityStorageException::extractTableFromPreviousExceptionMessage()
- 3.0.x src/Exception/LingotekContentEntityStorageException.php \Drupal\lingotek\Exception\LingotekContentEntityStorageException::extractTableFromPreviousExceptionMessage()
- 3.1.x src/Exception/LingotekContentEntityStorageException.php \Drupal\lingotek\Exception\LingotekContentEntityStorageException::extractTableFromPreviousExceptionMessage()
- 3.3.x src/Exception/LingotekContentEntityStorageException.php \Drupal\lingotek\Exception\LingotekContentEntityStorageException::extractTableFromPreviousExceptionMessage()
- 3.4.x src/Exception/LingotekContentEntityStorageException.php \Drupal\lingotek\Exception\LingotekContentEntityStorageException::extractTableFromPreviousExceptionMessage()
- 3.5.x src/Exception/LingotekContentEntityStorageException.php \Drupal\lingotek\Exception\LingotekContentEntityStorageException::extractTableFromPreviousExceptionMessage()
- 3.6.x src/Exception/LingotekContentEntityStorageException.php \Drupal\lingotek\Exception\LingotekContentEntityStorageException::extractTableFromPreviousExceptionMessage()
- 3.7.x src/Exception/LingotekContentEntityStorageException.php \Drupal\lingotek\Exception\LingotekContentEntityStorageException::extractTableFromPreviousExceptionMessage()
- 3.8.x src/Exception/LingotekContentEntityStorageException.php \Drupal\lingotek\Exception\LingotekContentEntityStorageException::extractTableFromPreviousExceptionMessage()
Extract the problematic table from the previous exception message.
@returns A string with the problematic table name.
Parameters
\Exception $previous:
1 call to LingotekContentEntityStorageException::extractTableFromPreviousExceptionMessage()
File
- src/
Exception/ LingotekContentEntityStorageException.php, line 48
Class
- LingotekContentEntityStorageException
- An exception for issues when storing content entity translations.
Namespace
Drupal\lingotek\ExceptionCode
protected function extractTableFromPreviousExceptionMessage(\Exception $previous = NULL) {
$table = '';
if ($previous !== NULL) {
// Previous message would be like:
// "Data too long for column 'name' at row 2"
$previous_message = $previous
->getMessage();
$strings = explode("'", $previous_message);
$table = count($strings) > 1 ? $strings[1] : '';
}
return $table;
}