You are here

interface LingotekConfigurationServiceInterface in Lingotek Translation 8

Same name and namespace in other branches
  1. 8.2 src/LingotekConfigurationServiceInterface.php \Drupal\lingotek\LingotekConfigurationServiceInterface
  2. 4.0.x src/LingotekConfigurationServiceInterface.php \Drupal\lingotek\LingotekConfigurationServiceInterface
  3. 3.0.x src/LingotekConfigurationServiceInterface.php \Drupal\lingotek\LingotekConfigurationServiceInterface
  4. 3.1.x src/LingotekConfigurationServiceInterface.php \Drupal\lingotek\LingotekConfigurationServiceInterface
  5. 3.2.x src/LingotekConfigurationServiceInterface.php \Drupal\lingotek\LingotekConfigurationServiceInterface
  6. 3.3.x src/LingotekConfigurationServiceInterface.php \Drupal\lingotek\LingotekConfigurationServiceInterface
  7. 3.4.x src/LingotekConfigurationServiceInterface.php \Drupal\lingotek\LingotekConfigurationServiceInterface
  8. 3.5.x src/LingotekConfigurationServiceInterface.php \Drupal\lingotek\LingotekConfigurationServiceInterface
  9. 3.6.x src/LingotekConfigurationServiceInterface.php \Drupal\lingotek\LingotekConfigurationServiceInterface
  10. 3.7.x src/LingotekConfigurationServiceInterface.php \Drupal\lingotek\LingotekConfigurationServiceInterface
  11. 3.8.x src/LingotekConfigurationServiceInterface.php \Drupal\lingotek\LingotekConfigurationServiceInterface

Defines service for accessing the Lingotek configuration.

Hierarchy

Expanded class hierarchy of LingotekConfigurationServiceInterface

All classes that implement LingotekConfigurationServiceInterface

19 files declare their use of LingotekConfigurationServiceInterface
ContentTranslationLocalTasks.php in src/Plugin/Derivative/ContentTranslationLocalTasks.php
Contains \Drupal\lingotek\Plugin\Derivative\ContentTranslationLocalTasks.
LingotekConfigBulkFormTest.php in src/Tests/Form/LingotekConfigBulkFormTest.php
LingotekConfigImportTest.php in src/Tests/LingotekConfigImportTest.php
Contains \Drupal\lingotek\Tests\LingotekConfigImportTest.
LingotekConfigManagementForm.php in src/Form/LingotekConfigManagementForm.php
Contains \Drupal\Lingotek\Form\LingotekConfigManagementForm.
LingotekConfigSubscriber.php in src/EventSubscriber/LingotekConfigSubscriber.php
Contains \Drupal\lingotek\EventSubscriber\LingotekConfigSubscriber.

... See full list

File

src/LingotekConfigurationServiceInterface.php, line 17
Contains \Drupal\lingotek\LingotekConfigurationServiceInterface

Namespace

Drupal\lingotek
View source
interface LingotekConfigurationServiceInterface {

  /**
   * Gets the entity types that are enabled for Lingotek content translation.
   *
   * @return \Drupal\Core\Entity\EntityTypeInterface[]
   *   An array of entity types that are enabled for Lingotek content translation.
   */
  public function getEnabledEntityTypes();

  /**
   * Determines whether the given entity type is Lingotek translatable.
   *
   * @param string $entity_type_id
   *   The type of the entity.
   * @param string $bundle
   *   (optional) The bundle of the entity. If no bundle is provided, all the
   *   available bundles are checked.
   *
   * @returns bool
   *   TRUE if the specified bundle is configured for Lingotek translation.
   *   If no bundle is provided returns TRUE if at least one of the entity
   *   bundles is translatable.
   *
   */
  public function isEnabled($entity_type_id, $bundle = NULL);

  /**
   * Sets whether the given entity type is Lingotek translatable.
   *
   * @param string $entity_type_id
   *   The type of the entity.
   * @param string $bundle
   *   The bundle of the entity.
   * @param bool $enabled
   *   Flag. Defaults to TRUE.
   */
  public function setEnabled($entity_type_id, $bundle, $enabled = TRUE);

  /**
   * Determines the default Lingotek profile for the given config object.
   *
   * @param string $plugin_id
   *   The type of the config.
   * @param bool $provide_default
   *   If TRUE, and the entity does not have a profile, will retrieve the default
   *   for this entity type and bundle. Defaults to TRUE.
   *
   * @returns string
   *   The profile id.
   *
   */
  public function getConfigDefaultProfileId($plugin_id, $provide_default = TRUE);

  /**
   * Determines the default Lingotek profile for the given config entity type.
   *
   * @param string $plugin_id
   *   The type of the entity.
   * @param bool $provide_default
   *   If TRUE, and the entity does not have a profile, will retrieve the default
   *   for this entity type and bundle. Defaults to TRUE.
   *
   * @returns string
   *   The profile id.
   *
   */
  public function getConfigEntityDefaultProfileId($plugin_id, $provide_default = TRUE);

  /**
   * Determines the default Lingotek profile for the given entity type.
   *
   * @param string $entity_type_id
   *   The type of the entity.
   * @param string $bundle
   *   The bundle of the entity.
   *
   * @returns string
   *   The profile id.
   *
   */
  public function getDefaultProfileId($entity_type_id, $bundle);

  /**
   * Sets the default Lingotek profile for the given entity type.
   *
   * @param string $entity_type_id
   *   The type of the entity.
   * @param string $bundle
   *   The bundle of the entity.
   * @param string $profile_id
   *   The profile id.
   */
  public function setDefaultProfileId($entity_type_id, $bundle, $profile_id);

  /**
   * Determines the default Lingotek profile for the given entity.
   *
   * @param string $plugin_id
   *   The config plugin id.
   * @param bool $provide_default
   *   If TRUE, and the entity does not have a profile, will retrieve the default
   *   for this entity type and bundle. Defaults to TRUE.
   *
   * @returns LingotekProfile
   *   The default profile.
   */
  public function getConfigProfile($plugin_id, $provide_default = TRUE);

  /**
   * Determines the default Lingotek profile for the given entity.
   *
   * @param ConfigEntityInterface $entity
   *   The entity.
   * @param bool $provide_default
   *   If TRUE, and the entity does not have a profile, will retrieve the default
   *   for this entity type and bundle. Defaults to TRUE.
   *
   * @returns LingotekProfile
   *   The default profile.
   */
  public function getConfigEntityProfile(ConfigEntityInterface $entity, $provide_default = TRUE);

  /**
   * Determines the default Lingotek profile for the given entity.
   *
   * @param ContentEntityInterface $entity
   *   The entity.
   * @param bool $provide_default
   *   If TRUE, and the entity does not have a profile, will retrieve the default
   *   for this entity type and bundle. Defaults to TRUE.
   *
   * @returns LingotekProfile
   *   The default profile.
   */
  public function getEntityProfile(ContentEntityInterface $entity, $provide_default = TRUE);

  /**
   * Sets the default Lingotek profile for the given entity.
   *
   * @param ContentEntityInterface $entity
   *   The entity.
   * @param string $profile_id
   *   The profile id.
   * @param bool $save
   *   Indicates if we should save the entity after setting the value.
   */
  public function setProfile(ContentEntityInterface &$entity, $profile_id, $save = TRUE);

  /**
   * Helper function for getting all the profiles as select options.
   *
   * @return array
   *   Profiles as a valid select options property.
   */
  public function getProfileOptions();

  /**
   * Gets the Lingotek enabled fields for a given bundle.
   *
   * @param string $entity_type_id
   *   The type of the entity.
   * @param string $bundle
   *   The bundle of the entity.
   *
   * @returns array
   *   Array of field names.
   */
  public function getFieldsLingotekEnabled($entity_type_id, $bundle);

  /**
   * Determines if the field is enabled for Lingotek translation.
   *
   * @param string $entity_type_id
   *   The type of the entity.
   * @param string $bundle
   *   The bundle of the entity.
   * @param string $field_name
   *   The field of the bundle.
   *
   * @returns bool
   *   TRUE if the specified field is configured for Lingotek translation.
   */
  public function isFieldLingotekEnabled($entity_type_id, $bundle, $field_name);

  /**
   * Sets the field as enabled for Lingotek translation.
   *
   * @param string $entity_type_id
   *   The type of the entity.
   * @param string $bundle
   *   The bundle of the entity.
   * @param string $field_name
   *   The field of the bundle.
   * @param bool $enabled
   *   Flag. Defaults to TRUE.
   */
  public function setFieldLingotekEnabled($entity_type_id, $bundle, $field_name, $enabled = TRUE);

  /**
   * Gets the configured properties of a field that are enabled for Lingotek translation.
   *
   * @param string $entity_type_id
   *   The type of the entity.
   * @param string $bundle
   *   The bundle of the entity.
   * @param string $field_name
   *   The field of the bundle.
   *
   * @returns string[]
   *   Field properties that are enabled.
   */
  public function getFieldPropertiesLingotekEnabled($entity_type_id, $bundle, $field_name);

  /**
   * Sets the configured properties of a field that are enabled for Lingotek translation.
   *
   * @param string $entity_type_id
   *   The type of the entity.
   * @param string $bundle
   *   The bundle of the entity.
   * @param string $field_name
   *   The field of the bundle.
   * @param string[] $properties
   *   Field properties that are enabled.
   */
  public function setFieldPropertiesLingotekEnabled($entity_type_id, $bundle, $field_name, array $properties);

  /**
   * Determines if remote documents must be deleted after disassociation.
   *
   * @return boolean
   */
  public function mustDeleteRemoteAfterDisassociation();

  /**
   * Sets if remote documents must be deleted after disassociation.
   *
   * @param boolean $delete
   *   TRUE if remote documents must be deleted, FALSE otherwise.
   */
  public function setDeleteRemoteAfterDisassociation($delete);

  /**
   * Gets the value from the preferences configuration.
   *
   * @param string $preference_id
   *   The preference ID.
   * @return mixed
   */
  public function getPreference($preference_id);

  /**
   * Sets the value for the preferences configuration.
   *
   * @param string $preference_id
   *   The preference ID.
   * @param mixed $value
   *   The preference value.
   */
  public function setPreference($preference_id, $value);

  /**
   * Checks if a language is enabled in the Lingotek interface.
   *
   * @param \Drupal\language\ConfigurableLanguageInterface $language
   *   The language to check.
   *
   * @return bool
   *   TRUE if the language is enabled. FALSE if it is disabled.
   */
  public function isLanguageEnabled(ConfigurableLanguageInterface $language);

  /**
   * Enables a language from the Lingotek interface.
   *
   * @param \Drupal\language\ConfigurableLanguageInterface $language
   *   The language to be enabled.
   */
  public function enableLanguage(ConfigurableLanguageInterface $language);

  /**
   * Disables a language from the Lingotek interface.
   *
   * @param \Drupal\language\ConfigurableLanguageInterface $language
   *   The language to be disabled.
   */
  public function disableLanguage(ConfigurableLanguageInterface $language);

}

Members

Namesort descending Modifiers Type Description Overrides
LingotekConfigurationServiceInterface::disableLanguage public function Disables a language from the Lingotek interface. 1
LingotekConfigurationServiceInterface::enableLanguage public function Enables a language from the Lingotek interface. 1
LingotekConfigurationServiceInterface::getConfigDefaultProfileId public function Determines the default Lingotek profile for the given config object. 1
LingotekConfigurationServiceInterface::getConfigEntityDefaultProfileId public function Determines the default Lingotek profile for the given config entity type. 1
LingotekConfigurationServiceInterface::getConfigEntityProfile public function Determines the default Lingotek profile for the given entity. 1
LingotekConfigurationServiceInterface::getConfigProfile public function Determines the default Lingotek profile for the given entity. 1
LingotekConfigurationServiceInterface::getDefaultProfileId public function Determines the default Lingotek profile for the given entity type. 1
LingotekConfigurationServiceInterface::getEnabledEntityTypes public function Gets the entity types that are enabled for Lingotek content translation. 1
LingotekConfigurationServiceInterface::getEntityProfile public function Determines the default Lingotek profile for the given entity. 1
LingotekConfigurationServiceInterface::getFieldPropertiesLingotekEnabled public function Gets the configured properties of a field that are enabled for Lingotek translation. 1
LingotekConfigurationServiceInterface::getFieldsLingotekEnabled public function Gets the Lingotek enabled fields for a given bundle. 1
LingotekConfigurationServiceInterface::getPreference public function Gets the value from the preferences configuration. 1
LingotekConfigurationServiceInterface::getProfileOptions public function Helper function for getting all the profiles as select options. 1
LingotekConfigurationServiceInterface::isEnabled public function Determines whether the given entity type is Lingotek translatable. 1
LingotekConfigurationServiceInterface::isFieldLingotekEnabled public function Determines if the field is enabled for Lingotek translation. 1
LingotekConfigurationServiceInterface::isLanguageEnabled public function Checks if a language is enabled in the Lingotek interface. 1
LingotekConfigurationServiceInterface::mustDeleteRemoteAfterDisassociation public function Determines if remote documents must be deleted after disassociation. 1
LingotekConfigurationServiceInterface::setDefaultProfileId public function Sets the default Lingotek profile for the given entity type. 1
LingotekConfigurationServiceInterface::setDeleteRemoteAfterDisassociation public function Sets if remote documents must be deleted after disassociation. 1
LingotekConfigurationServiceInterface::setEnabled public function Sets whether the given entity type is Lingotek translatable. 1
LingotekConfigurationServiceInterface::setFieldLingotekEnabled public function Sets the field as enabled for Lingotek translation. 1
LingotekConfigurationServiceInterface::setFieldPropertiesLingotekEnabled public function Sets the configured properties of a field that are enabled for Lingotek translation. 1
LingotekConfigurationServiceInterface::setPreference public function Sets the value for the preferences configuration. 1
LingotekConfigurationServiceInterface::setProfile public function Sets the default Lingotek profile for the given entity. 1