60 lines
1.4 KiB
PHP
60 lines
1.4 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->getTitle()}";
|
|
}
|
|
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;
|
|
}
|
|
}
|