diff --git a/migrations/Version20221007204956.php b/migrations/Version20221007204956.php new file mode 100644 index 0000000..6f21cfc --- /dev/null +++ b/migrations/Version20221007204956.php @@ -0,0 +1,32 @@ +addSql('CREATE TABLE wantedvehicle (id INT NOT NULL, type VARCHAR(255) NOT NULL, numberplate VARCHAR(255) DEFAULT NULL, model VARCHAR(255) DEFAULT NULL, content TEXT NOT NULL, color VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); + $this->addSql('ALTER TABLE wantedvehicle ADD CONSTRAINT FK_42BDD5B7BF396750 FOREIGN KEY (id) REFERENCES document (id) ON DELETE CASCADE'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('DROP TABLE wantedvehicle'); + } +} diff --git a/migrations/Version20221007210348.php b/migrations/Version20221007210348.php new file mode 100644 index 0000000..990885f --- /dev/null +++ b/migrations/Version20221007210348.php @@ -0,0 +1,31 @@ +addSql('ALTER TABLE wantedvehicle CHANGE content content TEXT DEFAULT NULL'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE wantedvehicle CHANGE content content TEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`'); + } +} diff --git a/public/fonts/material/material-two-tones.woff2 b/public/fonts/material/material-two-tones.woff2 index de7b95a..8f79990 100644 Binary files a/public/fonts/material/material-two-tones.woff2 and b/public/fonts/material/material-two-tones.woff2 differ diff --git a/public/fonts/material/material.woff2 b/public/fonts/material/material.woff2 index 77fd18b..5492a6e 100644 Binary files a/public/fonts/material/material.woff2 and b/public/fonts/material/material.woff2 differ diff --git a/public/fonts/material/note.txt b/public/fonts/material/note.txt new file mode 100644 index 0000000..85d5fe9 --- /dev/null +++ b/public/fonts/material/note.txt @@ -0,0 +1 @@ +https://fonts.googleapis.com/css?family=Material+Icons+Two+Tone \ No newline at end of file diff --git a/src/Entity/Wantedvehicle.php b/src/Entity/Wantedvehicle.php new file mode 100644 index 0000000..acb5f26 --- /dev/null +++ b/src/Entity/Wantedvehicle.php @@ -0,0 +1,115 @@ +setNeedLegalAccess(true); + } + + public function getType(): ?string + { + return $this->type; + } + + public function setType(string $type): self + { + $this->type = $type; + + return $this; + } + + public function getNumberplate(): ?string + { + return $this->numberplate; + } + + public function setNumberplate(?string $numberplate): self + { + $this->numberplate = $numberplate; + + return $this; + } + + public function getModel(): ?string + { + return $this->model; + } + + public function setModel(?string $model): self + { + $this->model = $model; + + return $this; + } + + public function getContent(): ?string + { + return $this->content; + } + + public function setContent(?string $content): self + { + $this->content = $content; + + return $this; + } + + public function getColor(): ?string + { + return $this->color; + } + + public function setColor(?string $color): self + { + $this->color = $color; + + return $this; + } +} diff --git a/src/Form/WantedvehicleType.php b/src/Form/WantedvehicleType.php new file mode 100644 index 0000000..ea9d654 --- /dev/null +++ b/src/Form/WantedvehicleType.php @@ -0,0 +1,34 @@ +add('type', VehicleType::class) + ->add('numberplate', null, ['label' => 'form_label_numberplate']) + ->add('model', null, ['label' => 'form_label_model']) + ->add('color', null, ['label' => 'form_label_color']) + ->add('content', ContentType::class, ['label' => 'form_label_informations', 'required' => false]) + + ; + } + + public function configureOptions(OptionsResolver $resolver) + { + $resolver->setDefaults([ + 'data_class' => Wantedvehicle::class, + ]); + } +} diff --git a/src/Repository/WantedvehicleRepository.php b/src/Repository/WantedvehicleRepository.php new file mode 100644 index 0000000..e0e9702 --- /dev/null +++ b/src/Repository/WantedvehicleRepository.php @@ -0,0 +1,22 @@ +fields = ['type', 'numberplate','model', 'content', 'color']; //with title, list fields we can search in + } +} diff --git a/templates/base.html.twig b/templates/base.html.twig index ff1329e..f706353 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -145,7 +145,10 @@