vendor/vich/uploader-bundle/src/Mapping/Annotation/UploadableField.php line 30

Open in your IDE?
  1. <?php
  2. namespace Vich\UploaderBundle\Mapping\Annotation;
  3. use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor;
  4. use Vich\UploaderBundle\Mapping\AnnotationInterface;
  5. /**
  6.  * UploadableField.
  7.  *
  8.  * @Annotation
  9.  * @Target({"PROPERTY"})
  10.  * @NamedArgumentConstructor
  11.  *
  12.  * @deprecated since 2.9, use Vich\UploaderBundle\Mapping\Attribute\UploadableField instead
  13.  *
  14.  * @author Dustin Dobervich <ddobervich@gmail.com>
  15.  */
  16. #[\Attribute(\Attribute::TARGET_PROPERTY)]
  17. final class UploadableField implements AnnotationInterface
  18. {
  19.     public function __construct(
  20.         private readonly string $mapping,
  21.         private readonly ?string $fileNameProperty null,
  22.         private readonly ?string $size null,
  23.         private readonly ?string $mimeType null,
  24.         private readonly ?string $originalName null,
  25.         private readonly ?string $dimensions null
  26.     ) {
  27.         trigger_deprecation('vich/uploader-bundle''2.9''The "Vich\UploaderBundle\Mapping\Annotation\UploadableField" class is deprecated, use "Vich\UploaderBundle\Mapping\Attribute\UploadableField" instead.');
  28.     }
  29.     /**
  30.      * Gets the mapping name.
  31.      *
  32.      * @return string The mapping name
  33.      */
  34.     public function getMapping(): string
  35.     {
  36.         return $this->mapping;
  37.     }
  38.     /**
  39.      * Gets the file name property.
  40.      *
  41.      * @return string|null The file name property
  42.      */
  43.     public function getFileNameProperty(): ?string
  44.     {
  45.         return $this->fileNameProperty;
  46.     }
  47.     public function getSize(): ?string
  48.     {
  49.         return $this->size;
  50.     }
  51.     public function getMimeType(): ?string
  52.     {
  53.         return $this->mimeType;
  54.     }
  55.     public function getOriginalName(): ?string
  56.     {
  57.         return $this->originalName;
  58.     }
  59.     public function getDimensions(): ?string
  60.     {
  61.         return $this->dimensions;
  62.     }
  63. }