Backup of db before drupal security update
[yaffs-website] / web / core / modules / content_translation / src / ContentTranslationManagerInterface.php
1 <?php
2
3 namespace Drupal\content_translation;
4
5 use Drupal\Core\Entity\EntityInterface;
6
7 /**
8  * Provides an interface for common functionality for content translation.
9  */
10 interface ContentTranslationManagerInterface {
11
12   /**
13    * Gets the entity types that support content translation.
14    *
15    * @return \Drupal\Core\Entity\EntityTypeInterface[]
16    *   An array of entity types that support content translation.
17    */
18   public function getSupportedEntityTypes();
19
20   /**
21    * Checks whether an entity type supports translation.
22    *
23    * @param string $entity_type_id
24    *   The entity type.
25    *
26    * @return bool
27    *   TRUE if an entity type is supported, FALSE otherwise.
28    */
29   public function isSupported($entity_type_id);
30
31   /**
32    * Returns an instance of the Content translation handler.
33    *
34    * @param string $entity_type_id
35    *   The type of the entity being translated.
36    *
37    * @return \Drupal\content_translation\ContentTranslationHandlerInterface
38    *   An instance of the content translation handler.
39    */
40   public function getTranslationHandler($entity_type_id);
41
42   /**
43    * Returns an instance of the Content translation metadata.
44    *
45    * @param \Drupal\Core\Entity\EntityInterface $translation
46    *   The entity translation whose metadata needs to be retrieved.
47    *
48    * @return \Drupal\content_translation\ContentTranslationMetadataWrapperInterface
49    *   An instance of the content translation metadata.
50    */
51   public function getTranslationMetadata(EntityInterface $translation);
52
53   /**
54    * Sets the value for translatability of the given entity type bundle.
55    *
56    * @param string $entity_type_id
57    *   The entity type.
58    * @param string $bundle
59    *   The bundle of the entity.
60    * @param bool $value
61    *   The boolean value we need to save.
62    */
63   public function setEnabled($entity_type_id, $bundle, $value);
64
65   /**
66    * Determines whether the given entity type is translatable.
67    *
68    * @param string $entity_type_id
69    *   The type of the entity.
70    * @param string $bundle
71    *   (optional) The bundle of the entity. If no bundle is provided, all the
72    *   available bundles are checked.
73    *
74    * @returns bool
75    *   TRUE if the specified bundle is translatable. If no bundle is provided
76    *   returns TRUE if at least one of the entity bundles is translatable.
77    */
78   public function isEnabled($entity_type_id, $bundle = NULL);
79
80 }