ProfileInterface.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. namespace Drupal\linkit;
  3. use Drupal\Core\Config\Entity\ConfigEntityInterface;
  4. /**
  5. * Provides an interface defining a profile entity.
  6. */
  7. interface ProfileInterface extends ConfigEntityInterface {
  8. /**
  9. * Gets the profile description.
  10. *
  11. * @return string
  12. * The profile description.
  13. */
  14. public function getDescription();
  15. /**
  16. * Sets the profile description.
  17. *
  18. * @param string $description
  19. * The profile description.
  20. *
  21. * @return $this
  22. */
  23. public function setDescription($description);
  24. /**
  25. * Returns a specific matcher.
  26. *
  27. * @param string $instance_id
  28. * The matcher instance ID.
  29. *
  30. * @return \Drupal\linkit\MatcherInterface
  31. * The matcher object.
  32. */
  33. public function getMatcher($instance_id);
  34. /**
  35. * Returns the matchers for this profile.
  36. *
  37. * @return \Drupal\linkit\MatcherCollection|\Drupal\linkit\MatcherInterface[]
  38. * The matcher collection.
  39. */
  40. public function getMatchers();
  41. /**
  42. * Adds a matcher to this profile.
  43. *
  44. * @param array $configuration
  45. * An array of matcher configuration.
  46. *
  47. * @return string
  48. * The instance ID of the matcher.
  49. */
  50. public function addMatcher(array $configuration);
  51. /**
  52. * Removes a matcher from this profile.
  53. *
  54. * @param \Drupal\linkit\MatcherInterface $matcher
  55. * The matcher object.
  56. *
  57. * @return $this
  58. */
  59. public function removeMatcher(MatcherInterface $matcher);
  60. /**
  61. * Sets the configuration for a matcher instance.
  62. *
  63. * @param string $instance_id
  64. * The instance ID of the matcher to set the configuration for.
  65. * @param array $configuration
  66. * The matcher configuration to set.
  67. *
  68. * @return $this
  69. */
  70. public function setMatcherConfig($instance_id, array $configuration);
  71. }