Added an DB field for filetype filtering to attachment types.

This commit is contained in:
Jan Böhmer 2019-09-01 22:04:55 +02:00
parent af3dfafe22
commit c484e40758
2 changed files with 32 additions and 1 deletions

View file

@ -56,6 +56,7 @@ use App\Entity\Base\StructuralDBElement;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use s9e\TextFormatter\Configurator\RendererGenerators\PHP\XPathConvertor\Convertors\SingleByteStringManipulation;
/**
* Class AttachmentType.
@ -82,6 +83,12 @@ class AttachmentType extends StructuralDBElement
*/
protected $parent;
/**
* @var string
* @ORM\Column(type="string", length=65535)
*/
protected $filetype_filter;
/**
* Get all attachements ("Attachement" objects) with this type.
*
@ -98,6 +105,27 @@ class AttachmentType extends StructuralDBElement
return $this->attachments;
}
/**
* Gets an filter, which file types are allowed for attachment files.
* @return string
*/
public function getFiletypeFilter(): string
{
return $this->filetype_filter;
}
/**
* @param string $filetype_filter
* @return AttachmentType
*/
public function setFiletypeFilter(string $filetype_filter): AttachmentType
{
$this->filetype_filter = $filetype_filter;
return $this;
}
/**
* Returns the ID as an string, defined by the element class.
* This should have a form like P000014, for a part with ID 14.