LinkItemInterface.php 810 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. namespace Drupal\link;
  3. use Drupal\Core\Field\FieldItemInterface;
  4. /**
  5. * Defines an interface for the link field item.
  6. */
  7. interface LinkItemInterface extends FieldItemInterface {
  8. /**
  9. * Specifies whether the field supports only internal URLs.
  10. */
  11. const LINK_INTERNAL = 0x01;
  12. /**
  13. * Specifies whether the field supports only external URLs.
  14. */
  15. const LINK_EXTERNAL = 0x10;
  16. /**
  17. * Specifies whether the field supports both internal and external URLs.
  18. */
  19. const LINK_GENERIC = 0x11;
  20. /**
  21. * Determines if a link is external.
  22. *
  23. * @return bool
  24. * TRUE if the link is external, FALSE otherwise.
  25. */
  26. public function isExternal();
  27. /**
  28. * Gets the URL object.
  29. *
  30. * @return \Drupal\Core\Url
  31. * Returns a Url object.
  32. */
  33. public function getUrl();
  34. }