ViewLocationSuggestion.php 964 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace CMText\RichContent\Suggestions;
  3. use CMText\RichContent\Common\ViewLocationBase;
  4. /**
  5. * Class ViewLocationSuggestion
  6. * @package CMText\RichContent\Suggestions
  7. */
  8. class ViewLocationSuggestion extends SuggestionBase
  9. {
  10. /**
  11. * @var string Action command
  12. */
  13. protected $action = 'viewLocation';
  14. /**
  15. * @var ViewLocationBase
  16. */
  17. private $viewLocation;
  18. /**
  19. * ViewLocationSuggestion constructor.
  20. * @param string $Label
  21. * @param ViewLocationBase $ViewLocation
  22. */
  23. public function __construct(
  24. string $Label,
  25. ViewLocationBase $ViewLocation
  26. )
  27. {
  28. $this->label = $Label;
  29. $this->viewLocation = $ViewLocation;
  30. }
  31. #[\ReturnTypeWillChange]
  32. public function jsonSerialize()
  33. {
  34. return (object)[
  35. 'action' => $this->action,
  36. 'label' => $this->label,
  37. 'viewLocation' => $this->viewLocation,
  38. ];
  39. }
  40. }