[Media] File quota should be triggered by the Core

This commit is contained in:
2021-07-22 20:57:03 +01:00
committed by Hugo Sales
parent 488e700fab
commit 481e953cde
2 changed files with 18 additions and 6 deletions

View File

@@ -23,6 +23,7 @@ namespace App\Entity;
use App\Core\DB\DB;
use App\Core\Entity;
use App\Core\GSFile;
use App\Util\Common;
use DateTimeInterface;
@@ -126,6 +127,18 @@ class Attachment extends Entity
return $this->mimetype;
}
public function getMimetypeMajor(): ?string
{
$mime = $this->getMimetype();
return is_null($mime) ? $mime : GSFile::mimetypeMajor($mime);
}
public function getMimetypeMinor(): ?string
{
$mime = $this->getMimetype();
return is_null($mime) ? $mime : GSFile::mimetypeMinor($mime);
}
public function setTitle(?string $title): self
{
$this->title = $title;