diff --git a/src/Entity/Attachments/Attachment.php b/src/Entity/Attachments/Attachment.php index 7c07a465..bc3f52b8 100644 --- a/src/Entity/Attachments/Attachment.php +++ b/src/Entity/Attachments/Attachment.php @@ -71,8 +71,9 @@ abstract class Attachment extends AbstractNamedDBElement /** * @var string The class of the element that can be passed to this attachment. Must be overridden in subclasses. + * */ - public const ALLOWED_ELEMENT_CLASS = ''; + protected const ALLOWED_ELEMENT_CLASS = ''; /** * @var string|null the original filename the file had, when the user uploaded it @@ -463,4 +464,13 @@ abstract class Attachment extends AbstractNamedDBElement return (bool) filter_var($string, FILTER_VALIDATE_URL); } + + /** + * Returns the class of the element that is allowed to be associated with this attachment. + * @return string + */ + public function getElementClass(): string + { + return static::ALLOWED_ELEMENT_CLASS; + } } diff --git a/src/Entity/Parameters/AbstractParameter.php b/src/Entity/Parameters/AbstractParameter.php index b033c0ac..be918d00 100644 --- a/src/Entity/Parameters/AbstractParameter.php +++ b/src/Entity/Parameters/AbstractParameter.php @@ -64,7 +64,7 @@ abstract class AbstractParameter extends AbstractNamedDBElement /** * @var string The class of the element that can be passed to this attachment. Must be overridden in subclasses. */ - public const ALLOWED_ELEMENT_CLASS = ''; + protected const ALLOWED_ELEMENT_CLASS = ''; /** * @var string The mathematical symbol for this specification. Can be rendered pretty later. Should be short @@ -400,4 +400,13 @@ abstract class AbstractParameter extends AbstractNamedDBElement return $str; } + + /** + * Returns the class of the element that is allowed to be associated with this attachment. + * @return string + */ + public function getElementClass(): string + { + return static::ALLOWED_ELEMENT_CLASS; + } }