ProfileInterface.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <?php
  2. /**
  3. * @file
  4. * Contains \Drupal\linkit\ProfileInterface.
  5. */
  6. namespace Drupal\linkit;
  7. use Drupal\Core\Config\Entity\ConfigEntityInterface;
  8. /**
  9. * Provides an interface defining a profile entity.
  10. */
  11. interface ProfileInterface extends ConfigEntityInterface {
  12. /**
  13. * Gets the profile description.
  14. *
  15. * @return string
  16. * The profile description.
  17. */
  18. public function getDescription();
  19. /**
  20. * Sets the profile description.
  21. *
  22. * @param string $description
  23. * The profile description.
  24. *
  25. * @return $this
  26. */
  27. public function setDescription($description);
  28. /**
  29. * Returns a specific attribute.
  30. *
  31. * @param string $attribute_id
  32. * The attribute ID.
  33. *
  34. * @return \Drupal\linkit\AttributeInterface
  35. * The attribute object.
  36. */
  37. public function getAttribute($attribute_id);
  38. /**
  39. * Returns the attributes for this profile.
  40. *
  41. * @return \Drupal\linkit\AttributeCollection|\Drupal\linkit\AttributeInterface[]
  42. * The attribute collection.
  43. */
  44. public function getAttributes();
  45. /**
  46. * Adds an attribute to this profile.
  47. *
  48. * @param array $configuration
  49. * An array of attribute configuration.
  50. *
  51. * @return String
  52. * The ID of the attribute.
  53. */
  54. public function addAttribute(array $configuration);
  55. /**
  56. * Removes an attribute from this profile.
  57. *
  58. * @param string $attribute_id
  59. * The attribute ID.
  60. *
  61. * @return $this
  62. */
  63. public function removeAttribute($attribute_id);
  64. /**
  65. * Sets the configuration for an attribute instance.
  66. *
  67. * @param string $attribute_id
  68. * The ID of the attribute to set the configuration for.
  69. * @param array $configuration
  70. * The attribute configuration to set.
  71. *
  72. * @return $this
  73. */
  74. public function setAttributeConfig($attribute_id, array $configuration);
  75. /**
  76. * Returns a specific matcher.
  77. *
  78. * @param string $instance_id
  79. * The matcher instance ID.
  80. *
  81. * @return \Drupal\linkit\MatcherInterface
  82. * The matcher object.
  83. */
  84. public function getMatcher($instance_id);
  85. /**
  86. * Returns the matchers for this profile.
  87. *
  88. * @return \Drupal\linkit\MatcherCollection|\Drupal\linkit\MatcherInterface[]
  89. * The matcher collection.
  90. */
  91. public function getMatchers();
  92. /**
  93. * Adds a matcher to this profile.
  94. *
  95. * @param array $configuration
  96. * An array of matcher configuration.
  97. *
  98. * @return string
  99. * The instance ID of the matcher.
  100. */
  101. public function addMatcher(array $configuration);
  102. /**
  103. * Removes a matcher from this profile.
  104. *
  105. * @param \Drupal\linkit\MatcherInterface $matcher
  106. * The matcher object.
  107. *
  108. * @return $this
  109. */
  110. public function removeMatcher(MatcherInterface $matcher);
  111. /**
  112. * Sets the configuration for a matcher instance.
  113. *
  114. * @param string $instance_id
  115. * The instance ID of the matcher to set the configuration for.
  116. * @param array $configuration
  117. * The matcher configuration to set.
  118. *
  119. * @return $this
  120. */
  121. public function setMatcherConfig($instance_id, array $configuration);
  122. }