3 namespace BookStack\Permissions;
5 use BookStack\Entities\Models\Entity;
13 public ?int $chapter_id;
15 public static function fromEntity(Entity $entity): self
17 $attrs = $entity->getAttributes();
20 $simple->id = $attrs['id'];
21 $simple->type = $entity->getMorphClass();
22 $simple->owned_by = $attrs['owned_by'] ?? 0;
23 $simple->book_id = $attrs['book_id'] ?? null;
24 $simple->chapter_id = $attrs['chapter_id'] ?? null;