61 lines
1.6 KiB
PHP
61 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace App\Entities\Mangboard;
|
|
|
|
use App\Models\Mangboard\FileModel;
|
|
use App\Entities\CommonEntity;
|
|
|
|
class FileEntity extends CommonEntity
|
|
{
|
|
public function __toString(): string
|
|
{
|
|
return "{$this->getPK()}|{$this->getPath()}|{$this->getTitle()}|{$this->getMimeType()}}|{$this->getSequence()}번째";
|
|
}
|
|
public function getTitle(): string
|
|
{
|
|
return $this->attributes[FileModel::TITLE];
|
|
}
|
|
public function setTitle(string $file_name): void
|
|
{
|
|
$this->attributes[FileModel::TITLE] = $file_name;
|
|
}
|
|
//Common Function
|
|
public function getPK(): int
|
|
{
|
|
return $this->attributes[FileModel::PK];
|
|
}
|
|
public function getPath(): string
|
|
{
|
|
return $this->attributes['file_path'];
|
|
}
|
|
public function setPath(string $file_path): void
|
|
{
|
|
$this->attributes['file_path'] = $file_path;
|
|
}
|
|
final public function getMimeType(): string
|
|
{
|
|
return $this->attributes['file_type'];
|
|
}
|
|
public function setMimeType(string $mimetype): void
|
|
{
|
|
$this->attributes['file_type'] = $mimetype;
|
|
}
|
|
final public function getSize(): int
|
|
{
|
|
return $this->attributes['file_size'];
|
|
}
|
|
public function setSize(int $file_size): void
|
|
{
|
|
$this->attributes['file_size'] = $file_size;
|
|
}
|
|
//한게시물에 여러개가 있을경우 번호
|
|
final public function getSequence(): int
|
|
{
|
|
return $this->attributes['file_sequence'];
|
|
}
|
|
public function setSequence(int $file_sequence): void
|
|
{
|
|
$this->attributes['file_sequence'] = $file_sequence;
|
|
}
|
|
}
|