Automation/app/Entities/MyStorage/FileEntity.php
2024-09-10 00:12:54 +09:00

69 lines
1.8 KiB
PHP

<?php
namespace App\Entities\MyStorage;
use App\Entities\CommonEntity;
class FileEntity extends CommonEntity
{
public function __construct(array|null $data = null)
{
parent::__construct($data);
}
public function __toString(): string
{
return "{$this->getPath()}|{$this->getTitle()}|{$this->getMimeType()}}|{$this->getSequence()}번째";
}
public function getTitle(): string
{
return $this->attributes['file_name'];
}
public function setTitle(string $file_name): void
{
$this->attributes['file_name'] = $file_name;
}
//Common Function
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 getMediaHTML(): string
{
return $this->attributes['media_html'];
}
public function setMediaHTML(string $media_html): void
{
$this->attributes['media_html'] = $media_html;
}
//한게시물에 여러개가 있을경우 번호
final public function getSequence(): int
{
return $this->attributes['file_sequence'];
}
public function setSequence(int $file_sequence): void
{
$this->attributes['file_sequence'] = $file_sequence;
}
}