public function LingotekConfigTranslationService::deleteMetadata in Lingotek Translation 3.2.x
Same name and namespace in other branches
- 8 src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::deleteMetadata()
- 8.2 src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::deleteMetadata()
- 4.0.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::deleteMetadata()
- 3.0.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::deleteMetadata()
- 3.1.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::deleteMetadata()
- 3.3.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::deleteMetadata()
- 3.4.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::deleteMetadata()
- 3.5.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::deleteMetadata()
- 3.6.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::deleteMetadata()
- 3.7.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::deleteMetadata()
- 3.8.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::deleteMetadata()
Deletes metadata.
Parameters
\Drupal\Core\Config\Entity\ConfigEntityInterface $entity: The entity which we want to delete.
Return value
ContentEntityInterface The entity.
Overrides LingotekConfigTranslationServiceInterface::deleteMetadata
4 calls to LingotekConfigTranslationService::deleteMetadata()
- LingotekConfigTranslationService::addTarget in src/
LingotekConfigTranslationService.php - Request a translation for a given entity in the given locale.
- LingotekConfigTranslationService::requestTranslations in src/
LingotekConfigTranslationService.php - Requests translations of a document in all the enabled locales.
- LingotekConfigTranslationService::setJobId in src/
LingotekConfigTranslationService.php - Sets the job ID of a given entity.
- LingotekConfigTranslationService::updateDocument in src/
LingotekConfigTranslationService.php - Resends a document to the translation service.
File
- src/
LingotekConfigTranslationService.php, line 844
Class
- LingotekConfigTranslationService
- Service for managing Lingotek configuration translations.
Namespace
Drupal\lingotekCode
public function deleteMetadata(ConfigEntityInterface &$entity) {
$doc_id = $this
->getDocumentId($entity);
if ($doc_id) {
$this
->cancelDocument($entity);
}
$metadata = LingotekConfigMetadata::loadByConfigName($entity
->getEntityTypeId() . '.' . $entity
->id());
if (!$metadata
->isNew()) {
$metadata
->delete();
}
}