3 namespace BookStack\Exports;
6 use Illuminate\Database\Eloquent\Factories\HasFactory;
7 use Illuminate\Database\Eloquent\Model;
10 * @property string $path
11 * @property string $name
12 * @property int $size - ZIP size in bytes
13 * @property int $book_count
14 * @property int $chapter_count
15 * @property int $page_count
16 * @property int $created_by
17 * @property Carbon $created_at
18 * @property Carbon $updated_at
20 class Import extends Model
24 public const TYPE_BOOK = 'book';
25 public const TYPE_CHAPTER = 'chapter';
26 public const TYPE_PAGE = 'page';
29 * Get the type (model) that this import is intended to be.
31 public function getType(): string
33 if ($this->book_count === 1) {
34 return self::TYPE_BOOK;
35 } elseif ($this->chapter_count === 1) {
36 return self::TYPE_CHAPTER;
39 return self::TYPE_PAGE;