3 namespace BookStack\Activity\Notifications\MessageParts;
5 use BookStack\Entities\Models\Entity;
6 use Illuminate\Contracts\Support\Htmlable;
10 * A link to a specific entity in the system, with the text showing its name.
12 class EntityPathMessageLine implements Htmlable, Stringable
15 * @var EntityLinkMessageLine[]
17 protected array $entityLinks;
19 public function __construct(
20 protected array $entities
22 $this->entityLinks = array_map(fn (Entity $entity) => new EntityLinkMessageLine($entity, 24), $this->entities);
25 public function toHtml(): string
27 $entityHtmls = array_map(fn (EntityLinkMessageLine $line) => $line->toHtml(), $this->entityLinks);
28 return implode(' > ', $entityHtmls);
31 public function __toString(): string
33 return implode(' > ', $this->entityLinks);