From d2f182e7f2144177b90e01034d28183c9ac3b9d0 Mon Sep 17 00:00:00 2001 From: Ion Bazan Date: Thu, 5 Aug 2021 18:32:36 +0800 Subject: [PATCH] Hardcode file column names Co-authored-by: Fran Moreno --- .../ODM/MongoDB/Mapping/Annotations/File/Filename.php | 4 ++-- lib/Doctrine/ODM/MongoDB/Mapping/Annotations/File/Length.php | 4 ++-- .../ODM/MongoDB/Mapping/Annotations/File/Metadata.php | 3 +-- .../ODM/MongoDB/Mapping/Annotations/File/UploadDate.php | 4 ++-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/File/Filename.php b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/File/Filename.php index a26d52de50..260a78afd3 100644 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/File/Filename.php +++ b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/File/Filename.php @@ -15,8 +15,8 @@ #[Attribute(Attribute::TARGET_PROPERTY)] final class Filename extends AbstractField { - public function __construct(?string $name = 'filename') + public function __construct() { - parent::__construct($name, 'string', false, [], null, true); + parent::__construct('filename', 'string', false, [], null, true); } } diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/File/Length.php b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/File/Length.php index a0d9b6a961..b960ae29bc 100644 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/File/Length.php +++ b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/File/Length.php @@ -15,8 +15,8 @@ #[Attribute(Attribute::TARGET_PROPERTY)] final class Length extends AbstractField { - public function __construct(?string $name = 'length') + public function __construct() { - parent::__construct($name, 'int', false, [], null, true); + parent::__construct('length', 'int', false, [], null, true); } } diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/File/Metadata.php b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/File/Metadata.php index 7a77d8399e..e2d337f87b 100644 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/File/Metadata.php +++ b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/File/Metadata.php @@ -32,7 +32,6 @@ final class Metadata extends AbstractField public $defaultDiscriminatorValue; public function __construct( - ?string $name = 'metadata', bool $nullable = false, array $options = [], ?string $strategy = null, @@ -42,7 +41,7 @@ public function __construct( ?array $discriminatorMap = null, ?string $defaultDiscriminatorValue = null ) { - parent::__construct($name, ClassMetadata::ONE, $nullable, $options, $strategy, $notSaved); + parent::__construct('metadata', ClassMetadata::ONE, $nullable, $options, $strategy, $notSaved); $this->targetDocument = $targetDocument; $this->discriminatorField = $discriminatorField; diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/File/UploadDate.php b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/File/UploadDate.php index bdea254ae4..1454fe993d 100644 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/File/UploadDate.php +++ b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/File/UploadDate.php @@ -15,8 +15,8 @@ #[Attribute(Attribute::TARGET_PROPERTY)] final class UploadDate extends AbstractField { - public function __construct(?string $name = 'uploadDate', string $type = 'date') + public function __construct() { - parent::__construct($name, $type, false, [], null, true); + parent::__construct('uploadDate', 'date', false, [], null, true); } }