Version 1
[yaffs-website] / web / core / lib / Drupal / Core / TypedData / TranslationStatusInterface.php
diff --git a/web/core/lib/Drupal/Core/TypedData/TranslationStatusInterface.php b/web/core/lib/Drupal/Core/TypedData/TranslationStatusInterface.php
new file mode 100644 (file)
index 0000000..520b0fc
--- /dev/null
@@ -0,0 +1,37 @@
+<?php
+
+namespace Drupal\Core\TypedData;
+
+/**
+ * Defines an interface for checking the status of an entity translation.
+ */
+interface TranslationStatusInterface {
+
+  /**
+   * Status code identifying a removed translation.
+   */
+  const TRANSLATION_REMOVED = 0;
+
+  /**
+   * Status code identifying an existing translation.
+   */
+  const TRANSLATION_EXISTING = 1;
+
+  /**
+   * Status code identifying a newly created translation.
+   */
+  const TRANSLATION_CREATED = 2;
+
+  /**
+   * Returns the translation status.
+   *
+   * @param string $langcode
+   *   The language code identifying the translation.
+   *
+   * @return int|null
+   *   One of the TRANSLATION_* constants or NULL if the given translation does
+   *   not exist.
+   */
+  public function getTranslationStatus($langcode);
+
+}