ThirdPartySettingsInterface.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. namespace Drupal\Core\Config\Entity;
  3. /**
  4. * Interface for configuration entities to store third party information.
  5. *
  6. * A third party is a module that needs to store tightly coupled information to
  7. * the configuration entity. For example, a module alters the node type form
  8. * can use this to store its configuration so that it will be deployed with the
  9. * node type.
  10. */
  11. interface ThirdPartySettingsInterface {
  12. /**
  13. * Sets the value of a third-party setting.
  14. *
  15. * @param string $module
  16. * The module providing the third-party setting.
  17. * @param string $key
  18. * The setting name.
  19. * @param mixed $value
  20. * The setting value.
  21. *
  22. * @return $this
  23. */
  24. public function setThirdPartySetting($module, $key, $value);
  25. /**
  26. * Gets the value of a third-party setting.
  27. *
  28. * @param string $module
  29. * The module providing the third-party setting.
  30. * @param string $key
  31. * The setting name.
  32. * @param mixed $default
  33. * The default value
  34. *
  35. * @return mixed
  36. * The value.
  37. */
  38. public function getThirdPartySetting($module, $key, $default = NULL);
  39. /**
  40. * Gets all third-party settings of a given module.
  41. *
  42. * @param string $module
  43. * The module providing the third-party settings.
  44. *
  45. * @return array
  46. * An array of key-value pairs.
  47. */
  48. public function getThirdPartySettings($module);
  49. /**
  50. * Unsets a third-party setting.
  51. *
  52. * @param string $module
  53. * The module providing the third-party setting.
  54. * @param string $key
  55. * The setting name.
  56. *
  57. * @return mixed
  58. * The value.
  59. */
  60. public function unsetThirdPartySetting($module, $key);
  61. /**
  62. * Gets the list of third parties that store information.
  63. *
  64. * @return array
  65. * The list of third parties.
  66. */
  67. public function getThirdPartyProviders();
  68. }