From 2812dbc79109def127fc2019fe9bcebfe819050d Mon Sep 17 00:00:00 2001 From: "Alex. Plokhikh" Date: Mon, 22 Apr 2024 10:33:23 +0500 Subject: [PATCH 01/14] STA-959|add entities, add migration --- .gitignore | 3 +- app/config/packages/doctrine.yaml | 2 + app/migrations/Version20240419135600.php | 148 ++++++ app/src/Entity/Address.php | 51 ++ app/src/Entity/Email.php | 51 ++ app/src/Entity/Kitchens.php | 75 +++ app/src/Entity/News.php | 230 +++++++++ app/src/Entity/NewsCategories.php | 50 ++ app/src/Entity/NewsComments.php | 142 ++++++ app/src/Entity/NewsType.php | 93 ++++ app/src/Entity/Phone.php | 51 ++ app/src/Entity/RestauranTypes.php | 93 ++++ app/src/Entity/Restaurants.php | 461 ++++++++++++++++++ app/src/Entity/Settlements.php | 154 ++++++ app/src/Entity/Tags.php | 72 +++ app/src/Entity/Users.php | 221 +++++++++ app/src/Repository/AddressRepository.php | 48 ++ app/src/Repository/EmailRepository.php | 48 ++ app/src/Repository/KitchensRepository.php | 48 ++ .../Repository/NewsCategoriesRepository.php | 48 ++ app/src/Repository/NewsCommentsRepository.php | 48 ++ app/src/Repository/NewsRepository.php | 48 ++ app/src/Repository/NewsTypeRepository.php | 48 ++ app/src/Repository/PhoneRepository.php | 48 ++ .../Repository/RestauranTypesRepository.php | 48 ++ app/src/Repository/RestaurantsRepository.php | 48 ++ app/src/Repository/SettlementsRepository.php | 48 ++ app/src/Repository/TagsRepository.php | 48 ++ app/src/Repository/UsersRepository.php | 48 ++ app/templates/news_types/index.html.twig | 20 + docker/docker-compose.yml | 19 +- 31 files changed, 2550 insertions(+), 10 deletions(-) create mode 100644 app/migrations/Version20240419135600.php create mode 100644 app/src/Entity/Address.php create mode 100644 app/src/Entity/Email.php create mode 100644 app/src/Entity/Kitchens.php create mode 100644 app/src/Entity/News.php create mode 100644 app/src/Entity/NewsCategories.php create mode 100644 app/src/Entity/NewsComments.php create mode 100644 app/src/Entity/NewsType.php create mode 100644 app/src/Entity/Phone.php create mode 100644 app/src/Entity/RestauranTypes.php create mode 100644 app/src/Entity/Restaurants.php create mode 100644 app/src/Entity/Settlements.php create mode 100644 app/src/Entity/Tags.php create mode 100644 app/src/Entity/Users.php create mode 100644 app/src/Repository/AddressRepository.php create mode 100644 app/src/Repository/EmailRepository.php create mode 100644 app/src/Repository/KitchensRepository.php create mode 100644 app/src/Repository/NewsCategoriesRepository.php create mode 100644 app/src/Repository/NewsCommentsRepository.php create mode 100644 app/src/Repository/NewsRepository.php create mode 100644 app/src/Repository/NewsTypeRepository.php create mode 100644 app/src/Repository/PhoneRepository.php create mode 100644 app/src/Repository/RestauranTypesRepository.php create mode 100644 app/src/Repository/RestaurantsRepository.php create mode 100644 app/src/Repository/SettlementsRepository.php create mode 100644 app/src/Repository/TagsRepository.php create mode 100644 app/src/Repository/UsersRepository.php create mode 100644 app/templates/news_types/index.html.twig diff --git a/.gitignore b/.gitignore index 723ef36..3bf780b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -.idea \ No newline at end of file +.idea +.env \ No newline at end of file diff --git a/app/config/packages/doctrine.yaml b/app/config/packages/doctrine.yaml index 75ec9e8..c94f706 100644 --- a/app/config/packages/doctrine.yaml +++ b/app/config/packages/doctrine.yaml @@ -1,6 +1,8 @@ doctrine: dbal: url: '%env(resolve:DATABASE_URL)%' + password: '%env(resolve:DATABASE_PASSWORD)%' + user: '%env(resolve:DATABASE_USER)%' # IMPORTANT: You MUST configure your server version, # either here or in the DATABASE_URL env var (see .env file) diff --git a/app/migrations/Version20240419135600.php b/app/migrations/Version20240419135600.php new file mode 100644 index 0000000..2502217 --- /dev/null +++ b/app/migrations/Version20240419135600.php @@ -0,0 +1,148 @@ +addSql('CREATE SEQUENCE address_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE email_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE kitchens_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE news_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE news_categories_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE news_comments_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE news_type_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE phone_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE restauran_types_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE restaurants_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE settlements_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE tags_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE users_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE TABLE address (id INT NOT NULL, restaurant_id_id INT NOT NULL, address VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX IDX_D4E6F8135592D86 ON address (restaurant_id_id)'); + $this->addSql('CREATE TABLE email (id INT NOT NULL, restaurant_id_id INT NOT NULL, email VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX IDX_E7927C7435592D86 ON email (restaurant_id_id)'); + $this->addSql('CREATE TABLE kitchens (id INT NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE news (id INT NOT NULL, type_id_id INT NOT NULL, code VARCHAR(255) NOT NULL, active BOOLEAN NOT NULL, create_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, update_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, sort INT NOT NULL, preview_image VARCHAR(255) DEFAULT NULL, detail_image VARCHAR(1000) DEFAULT NULL, preview_text VARCHAR(1000) DEFAULT NULL, detail_test VARCHAR(1000) DEFAULT NULL, main_page_render BOOLEAN NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX IDX_1DD39950714819A0 ON news (type_id_id)'); + $this->addSql('COMMENT ON COLUMN news.create_at IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('CREATE TABLE news_categories (id INT NOT NULL, name VARCHAR(255) NOT NULL, code VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE news_comments (id INT NOT NULL, news_id_id INT NOT NULL, moderator_id_id INT DEFAULT NULL, user_id_id INT DEFAULT NULL, moderated BOOLEAN DEFAULT NULL, user_name VARCHAR(255) NOT NULL, test VARCHAR(1000) NOT NULL, create_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, update_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX IDX_16A0357B5FB1909 ON news_comments (news_id_id)'); + $this->addSql('CREATE INDEX IDX_16A0357BCEB712DF ON news_comments (moderator_id_id)'); + $this->addSql('CREATE INDEX IDX_16A0357B9D86650F ON news_comments (user_id_id)'); + $this->addSql('COMMENT ON COLUMN news_comments.create_at IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('CREATE TABLE news_type (id INT NOT NULL, name VARCHAR(255) NOT NULL, code VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE phone (id INT NOT NULL, restaurant_id_id INT NOT NULL, phone_number VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX IDX_444F97DD35592D86 ON phone (restaurant_id_id)'); + $this->addSql('CREATE TABLE restauran_types (id INT NOT NULL, name VARCHAR(255) NOT NULL, code VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE restaurants (id INT NOT NULL, type_id_id INT NOT NULL, settlement_id_id INT NOT NULL, uuid UUID NOT NULL, name VARCHAR(255) NOT NULL, code VARCHAR(255) NOT NULL, active BOOLEAN NOT NULL, sort INT NOT NULL, create_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, update_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, coordinates TEXT NOT NULL, description VARCHAR(1000) DEFAULT NULL, recipe VARCHAR(255) DEFAULT NULL, recipe_info VARCHAR(1000) DEFAULT NULL, site VARCHAR(255) DEFAULT NULL, preview_image VARCHAR(255) DEFAULT NULL, detail_image VARCHAR(255) DEFAULT NULL, how_to_find VARCHAR(1000) DEFAULT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX IDX_AD837724714819A0 ON restaurants (type_id_id)'); + $this->addSql('CREATE INDEX IDX_AD83772445EC589B ON restaurants (settlement_id_id)'); + $this->addSql('COMMENT ON COLUMN restaurants.create_at IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('COMMENT ON COLUMN restaurants.coordinates IS \'(DC2Type:array)\''); + $this->addSql('CREATE TABLE restaurants_kitchens (restaurants_id INT NOT NULL, kitchens_id INT NOT NULL, PRIMARY KEY(restaurants_id, kitchens_id))'); + $this->addSql('CREATE INDEX IDX_716464694DCA160A ON restaurants_kitchens (restaurants_id)'); + $this->addSql('CREATE INDEX IDX_71646469E043FCBC ON restaurants_kitchens (kitchens_id)'); + $this->addSql('CREATE TABLE settlements (id INT NOT NULL, uuid UUID NOT NULL, name VARCHAR(255) NOT NULL, code VARCHAR(255) NOT NULL, coordinates TEXT NOT NULL, create_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, update_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, PRIMARY KEY(id))'); + $this->addSql('COMMENT ON COLUMN settlements.coordinates IS \'(DC2Type:array)\''); + $this->addSql('COMMENT ON COLUMN settlements.create_at IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('CREATE TABLE tags (id INT NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE tags_restaurants (tags_id INT NOT NULL, restaurants_id INT NOT NULL, PRIMARY KEY(tags_id, restaurants_id))'); + $this->addSql('CREATE INDEX IDX_7AEC1CD68D7B4FB4 ON tags_restaurants (tags_id)'); + $this->addSql('CREATE INDEX IDX_7AEC1CD64DCA160A ON tags_restaurants (restaurants_id)'); + $this->addSql('CREATE TABLE users (id INT NOT NULL, uuid UUID NOT NULL, name VARCHAR(255) NOT NULL, is_male BOOLEAN NOT NULL, birth_day TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, �ф�address VARCHAR(255) NOT NULL, surname VARCHAR(255) NOT NULL, phone_number VARCHAR(255) DEFAULT NULL, email VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))'); + $this->addSql('COMMENT ON COLUMN users.birth_day IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('CREATE TABLE messenger_messages (id BIGSERIAL NOT NULL, body TEXT NOT NULL, headers TEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, available_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, delivered_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX IDX_75EA56E0FB7336F0 ON messenger_messages (queue_name)'); + $this->addSql('CREATE INDEX IDX_75EA56E0E3BD61CE ON messenger_messages (available_at)'); + $this->addSql('CREATE INDEX IDX_75EA56E016BA31DB ON messenger_messages (delivered_at)'); + $this->addSql('COMMENT ON COLUMN messenger_messages.created_at IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('COMMENT ON COLUMN messenger_messages.available_at IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('COMMENT ON COLUMN messenger_messages.delivered_at IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('CREATE OR REPLACE FUNCTION notify_messenger_messages() RETURNS TRIGGER AS $$ + BEGIN + PERFORM pg_notify(\'messenger_messages\', NEW.queue_name::text); + RETURN NEW; + END; + $$ LANGUAGE plpgsql;'); + $this->addSql('DROP TRIGGER IF EXISTS notify_trigger ON messenger_messages;'); + $this->addSql('CREATE TRIGGER notify_trigger AFTER INSERT OR UPDATE ON messenger_messages FOR EACH ROW EXECUTE PROCEDURE notify_messenger_messages();'); + $this->addSql('ALTER TABLE address ADD CONSTRAINT FK_D4E6F8135592D86 FOREIGN KEY (restaurant_id_id) REFERENCES restaurants (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE email ADD CONSTRAINT FK_E7927C7435592D86 FOREIGN KEY (restaurant_id_id) REFERENCES restaurants (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE news ADD CONSTRAINT FK_1DD39950714819A0 FOREIGN KEY (type_id_id) REFERENCES news_type (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE news_comments ADD CONSTRAINT FK_16A0357B5FB1909 FOREIGN KEY (news_id_id) REFERENCES news (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE news_comments ADD CONSTRAINT FK_16A0357BCEB712DF FOREIGN KEY (moderator_id_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE news_comments ADD CONSTRAINT FK_16A0357B9D86650F FOREIGN KEY (user_id_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE phone ADD CONSTRAINT FK_444F97DD35592D86 FOREIGN KEY (restaurant_id_id) REFERENCES restaurants (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE restaurants ADD CONSTRAINT FK_AD837724714819A0 FOREIGN KEY (type_id_id) REFERENCES restauran_types (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE restaurants ADD CONSTRAINT FK_AD83772445EC589B FOREIGN KEY (settlement_id_id) REFERENCES settlements (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE restaurants_kitchens ADD CONSTRAINT FK_716464694DCA160A FOREIGN KEY (restaurants_id) REFERENCES restaurants (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE restaurants_kitchens ADD CONSTRAINT FK_71646469E043FCBC FOREIGN KEY (kitchens_id) REFERENCES kitchens (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE tags_restaurants ADD CONSTRAINT FK_7AEC1CD68D7B4FB4 FOREIGN KEY (tags_id) REFERENCES tags (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE tags_restaurants ADD CONSTRAINT FK_7AEC1CD64DCA160A FOREIGN KEY (restaurants_id) REFERENCES restaurants (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('CREATE SCHEMA public'); + $this->addSql('DROP SEQUENCE address_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE email_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE kitchens_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE news_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE news_categories_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE news_comments_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE news_type_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE phone_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE restauran_types_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE restaurants_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE settlements_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE tags_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE users_id_seq CASCADE'); + $this->addSql('ALTER TABLE address DROP CONSTRAINT FK_D4E6F8135592D86'); + $this->addSql('ALTER TABLE email DROP CONSTRAINT FK_E7927C7435592D86'); + $this->addSql('ALTER TABLE news DROP CONSTRAINT FK_1DD39950714819A0'); + $this->addSql('ALTER TABLE news_comments DROP CONSTRAINT FK_16A0357B5FB1909'); + $this->addSql('ALTER TABLE news_comments DROP CONSTRAINT FK_16A0357BCEB712DF'); + $this->addSql('ALTER TABLE news_comments DROP CONSTRAINT FK_16A0357B9D86650F'); + $this->addSql('ALTER TABLE phone DROP CONSTRAINT FK_444F97DD35592D86'); + $this->addSql('ALTER TABLE restaurants DROP CONSTRAINT FK_AD837724714819A0'); + $this->addSql('ALTER TABLE restaurants DROP CONSTRAINT FK_AD83772445EC589B'); + $this->addSql('ALTER TABLE restaurants_kitchens DROP CONSTRAINT FK_716464694DCA160A'); + $this->addSql('ALTER TABLE restaurants_kitchens DROP CONSTRAINT FK_71646469E043FCBC'); + $this->addSql('ALTER TABLE tags_restaurants DROP CONSTRAINT FK_7AEC1CD68D7B4FB4'); + $this->addSql('ALTER TABLE tags_restaurants DROP CONSTRAINT FK_7AEC1CD64DCA160A'); + $this->addSql('DROP TABLE address'); + $this->addSql('DROP TABLE email'); + $this->addSql('DROP TABLE kitchens'); + $this->addSql('DROP TABLE news'); + $this->addSql('DROP TABLE news_categories'); + $this->addSql('DROP TABLE news_comments'); + $this->addSql('DROP TABLE news_type'); + $this->addSql('DROP TABLE phone'); + $this->addSql('DROP TABLE restauran_types'); + $this->addSql('DROP TABLE restaurants'); + $this->addSql('DROP TABLE restaurants_kitchens'); + $this->addSql('DROP TABLE settlements'); + $this->addSql('DROP TABLE tags'); + $this->addSql('DROP TABLE tags_restaurants'); + $this->addSql('DROP TABLE users'); + $this->addSql('DROP TABLE messenger_messages'); + } +} diff --git a/app/src/Entity/Address.php b/app/src/Entity/Address.php new file mode 100644 index 0000000..f42f489 --- /dev/null +++ b/app/src/Entity/Address.php @@ -0,0 +1,51 @@ +id; + } + + public function getRestaurantId(): ?Restaurants + { + return $this->restaurant_id; + } + + public function setRestaurantId(?Restaurants $restaurant_id): static + { + $this->restaurant_id = $restaurant_id; + + return $this; + } + + public function getAddress(): ?string + { + return $this->address; + } + + public function setAddress(string $address): static + { + $this->address = $address; + + return $this; + } +} diff --git a/app/src/Entity/Email.php b/app/src/Entity/Email.php new file mode 100644 index 0000000..8d4b850 --- /dev/null +++ b/app/src/Entity/Email.php @@ -0,0 +1,51 @@ +id; + } + + public function getRestaurantId(): ?Restaurants + { + return $this->restaurant_id; + } + + public function setRestaurantId(?Restaurants $restaurant_id): static + { + $this->restaurant_id = $restaurant_id; + + return $this; + } + + public function getEmail(): ?string + { + return $this->email; + } + + public function setEmail(string $email): static + { + $this->email = $email; + + return $this; + } +} diff --git a/app/src/Entity/Kitchens.php b/app/src/Entity/Kitchens.php new file mode 100644 index 0000000..8aa783d --- /dev/null +++ b/app/src/Entity/Kitchens.php @@ -0,0 +1,75 @@ + + */ + #[ORM\ManyToMany(targetEntity: Restaurants::class, mappedBy: 'kitchens_id')] + private Collection $restaurants_id; + + public function __construct() + { + $this->restaurants_id = new ArrayCollection(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function getName(): ?string + { + return $this->name; + } + + public function setName(string $name): static + { + $this->name = $name; + + return $this; + } + + /** + * @return Collection + */ + public function getRestaurantsId(): Collection + { + return $this->restaurants_id; + } + + public function addRestaurantsId(Restaurants $restaurantsId): static + { + if (!$this->restaurants_id->contains($restaurantsId)) { + $this->restaurants_id->add($restaurantsId); + $restaurantsId->addKitchensId($this); + } + + return $this; + } + + public function removeRestaurantsId(Restaurants $restaurantsId): static + { + if ($this->restaurants_id->removeElement($restaurantsId)) { + $restaurantsId->removeKitchensId($this); + } + + return $this; + } +} diff --git a/app/src/Entity/News.php b/app/src/Entity/News.php new file mode 100644 index 0000000..bbc53be --- /dev/null +++ b/app/src/Entity/News.php @@ -0,0 +1,230 @@ + + */ + #[ORM\OneToMany(targetEntity: NewsComments::class, mappedBy: 'news_id')] + private Collection $news_comments_id; + + public function __construct() + { + $this->news_comments_id = new ArrayCollection(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function getCode(): ?string + { + return $this->code; + } + + public function setCode(string $code): static + { + $this->code = $code; + + return $this; + } + + public function isActive(): ?bool + { + return $this->active; + } + + public function setActive(bool $active): static + { + $this->active = $active; + + return $this; + } + + public function getCreateAt(): ?\DateTimeImmutable + { + return $this->create_at; + } + + public function setCreateAt(\DateTimeImmutable $create_at): static + { + $this->create_at = $create_at; + + return $this; + } + + public function getUpdateAt(): ?\DateTimeInterface + { + return $this->update_at; + } + + public function setUpdateAt(\DateTimeInterface $update_at): static + { + $this->update_at = $update_at; + + return $this; + } + + public function getSort(): ?int + { + return $this->sort; + } + + public function setSort(int $sort): static + { + $this->sort = $sort; + + return $this; + } + + public function getPreviewImage(): ?string + { + return $this->preview_image; + } + + public function setPreviewImage(?string $preview_image): static + { + $this->preview_image = $preview_image; + + return $this; + } + + public function getDetailImage(): ?string + { + return $this->detail_image; + } + + public function setDetailImage(?string $detail_image): static + { + $this->detail_image = $detail_image; + + return $this; + } + + public function getPreviewText(): ?string + { + return $this->preview_text; + } + + public function setPreviewText(?string $preview_text): static + { + $this->preview_text = $preview_text; + + return $this; + } + + public function getDetailTest(): ?string + { + return $this->detail_test; + } + + public function setDetailTest(?string $detail_test): static + { + $this->detail_test = $detail_test; + + return $this; + } + + public function getTypeId(): ?NewsType + { + return $this->type_id; + } + + public function setTypeId(?NewsType $type_id): static + { + $this->type_id = $type_id; + + return $this; + } + + public function isMainPageRender(): ?bool + { + return $this->main_page_render; + } + + public function setMainPageRender(bool $main_page_render): static + { + $this->main_page_render = $main_page_render; + + return $this; + } + + /** + * @return Collection + */ + public function getNewsCommentsId(): Collection + { + return $this->news_comments_id; + } + + public function addNewsCommentsId(NewsComments $newsCommentsId): static + { + if (!$this->news_comments_id->contains($newsCommentsId)) { + $this->news_comments_id->add($newsCommentsId); + $newsCommentsId->setNewsId($this); + } + + return $this; + } + + public function removeNewsCommentsId(NewsComments $newsCommentsId): static + { + if ($this->news_comments_id->removeElement($newsCommentsId)) { + // set the owning side to null (unless already changed) + if ($newsCommentsId->getNewsId() === $this) { + $newsCommentsId->setNewsId(null); + } + } + + return $this; + } +} diff --git a/app/src/Entity/NewsCategories.php b/app/src/Entity/NewsCategories.php new file mode 100644 index 0000000..8d86aa2 --- /dev/null +++ b/app/src/Entity/NewsCategories.php @@ -0,0 +1,50 @@ +id; + } + + public function getName(): ?string + { + return $this->name; + } + + public function setName(string $name): static + { + $this->name = $name; + + return $this; + } + + public function getCode(): ?string + { + return $this->code; + } + + public function setCode(string $code): static + { + $this->code = $code; + + return $this; + } +} diff --git a/app/src/Entity/NewsComments.php b/app/src/Entity/NewsComments.php new file mode 100644 index 0000000..04dc1a2 --- /dev/null +++ b/app/src/Entity/NewsComments.php @@ -0,0 +1,142 @@ +id; + } + + public function getNewsId(): ?News + { + return $this->news_id; + } + + public function setNewsId(?News $news_id): static + { + $this->news_id = $news_id; + + return $this; + } + + public function isModerated(): ?bool + { + return $this->moderated; + } + + public function setModerated(?bool $moderated): static + { + $this->moderated = $moderated; + + return $this; + } + + public function getModeratorId(): ?Users + { + return $this->moderator_id; + } + + public function setModeratorId(?Users $moderator_id): static + { + $this->moderator_id = $moderator_id; + + return $this; + } + + public function getUserName(): ?string + { + return $this->user_name; + } + + public function setUserName(string $user_name): static + { + $this->user_name = $user_name; + + return $this; + } + + public function getUserId(): ?Users + { + return $this->user_id; + } + + public function setUserId(?Users $user_id): static + { + $this->user_id = $user_id; + + return $this; + } + + public function getTest(): ?string + { + return $this->test; + } + + public function setTest(string $test): static + { + $this->test = $test; + + return $this; + } + + public function getCreateAt(): ?\DateTimeImmutable + { + return $this->create_at; + } + + public function setCreateAt(\DateTimeImmutable $create_at): static + { + $this->create_at = $create_at; + + return $this; + } + + public function getUpdateAt(): ?\DateTimeInterface + { + return $this->update_at; + } + + public function setUpdateAt(\DateTimeInterface $update_at): static + { + $this->update_at = $update_at; + + return $this; + } +} diff --git a/app/src/Entity/NewsType.php b/app/src/Entity/NewsType.php new file mode 100644 index 0000000..2959afb --- /dev/null +++ b/app/src/Entity/NewsType.php @@ -0,0 +1,93 @@ + + */ + #[ORM\OneToMany(targetEntity: News::class, mappedBy: 'type_id')] + private Collection $news_id; + + public function __construct() + { + $this->news_id = new ArrayCollection(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function getName(): ?string + { + return $this->name; + } + + public function setName(string $name): static + { + $this->name = $name; + + return $this; + } + + public function getCode(): ?string + { + return $this->code; + } + + public function setCode(string $code): static + { + $this->code = $code; + + return $this; + } + + /** + * @return Collection + */ + public function getNewsId(): Collection + { + return $this->news_id; + } + + public function addNewsId(News $newsId): static + { + if (!$this->news_id->contains($newsId)) { + $this->news_id->add($newsId); + $newsId->setTypeId($this); + } + + return $this; + } + + public function removeNewsId(News $newsId): static + { + if ($this->news_id->removeElement($newsId)) { + // set the owning side to null (unless already changed) + if ($newsId->getTypeId() === $this) { + $newsId->setTypeId(null); + } + } + + return $this; + } +} diff --git a/app/src/Entity/Phone.php b/app/src/Entity/Phone.php new file mode 100644 index 0000000..c808e22 --- /dev/null +++ b/app/src/Entity/Phone.php @@ -0,0 +1,51 @@ +id; + } + + public function getRestaurantId(): ?Restaurants + { + return $this->restaurant_id; + } + + public function setRestaurantId(?Restaurants $restaurant_id): static + { + $this->restaurant_id = $restaurant_id; + + return $this; + } + + public function getPhoneNumber(): ?string + { + return $this->phone_number; + } + + public function setPhoneNumber(string $phone_number): static + { + $this->phone_number = $phone_number; + + return $this; + } +} diff --git a/app/src/Entity/RestauranTypes.php b/app/src/Entity/RestauranTypes.php new file mode 100644 index 0000000..a4bb78f --- /dev/null +++ b/app/src/Entity/RestauranTypes.php @@ -0,0 +1,93 @@ + + */ + #[ORM\OneToMany(targetEntity: Restaurants::class, mappedBy: 'type_id')] + private Collection $restaurants_id; + + public function __construct() + { + $this->restaurants_id = new ArrayCollection(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function getName(): ?string + { + return $this->name; + } + + public function setName(string $name): static + { + $this->name = $name; + + return $this; + } + + public function getCode(): ?string + { + return $this->code; + } + + public function setCode(string $code): static + { + $this->code = $code; + + return $this; + } + + /** + * @return Collection + */ + public function getRestaurantsId(): Collection + { + return $this->restaurants_id; + } + + public function addRestaurantsId(Restaurants $restaurantsId): static + { + if (!$this->restaurants_id->contains($restaurantsId)) { + $this->restaurants_id->add($restaurantsId); + $restaurantsId->setTypeId($this); + } + + return $this; + } + + public function removeRestaurantsId(Restaurants $restaurantsId): static + { + if ($this->restaurants_id->removeElement($restaurantsId)) { + // set the owning side to null (unless already changed) + if ($restaurantsId->getTypeId() === $this) { + $restaurantsId->setTypeId(null); + } + } + + return $this; + } +} diff --git a/app/src/Entity/Restaurants.php b/app/src/Entity/Restaurants.php new file mode 100644 index 0000000..2f26637 --- /dev/null +++ b/app/src/Entity/Restaurants.php @@ -0,0 +1,461 @@ + + */ + #[ORM\ManyToMany(targetEntity: Kitchens::class, inversedBy: 'restaurants_id')] + private Collection $kitchens_id; + + /** + * @var Collection + */ + #[ORM\OneToMany(targetEntity: Phone::class, mappedBy: 'restaurant_id')] + private Collection $phones_id; + + /** + * @var Collection + */ + #[ORM\OneToMany(targetEntity: Email::class, mappedBy: 'restaurant_id')] + private Collection $emails_id; + + /** + * @var Collection + */ + #[ORM\OneToMany(targetEntity: Address::class, mappedBy: 'restaurant_id')] + private Collection $addresses_id; + + /** + * @var Collection + */ + #[ORM\ManyToMany(targetEntity: Tags::class, mappedBy: 'restaurant_id')] + private Collection $tags_id; + + #[ORM\Column(length: 255, nullable: true)] + private ?string $site = null; + + #[ORM\Column(length: 255, nullable: true)] + private ?string $preview_image = null; + + #[ORM\Column(length: 255, nullable: true)] + private ?string $detail_image = null; + + #[ORM\Column(length: 1000, nullable: true)] + private ?string $how_to_find = null; + + public function __construct() + { + $this->kitchens_id = new ArrayCollection(); + $this->phones_id = new ArrayCollection(); + $this->emails_id = new ArrayCollection(); + $this->addresses_id = new ArrayCollection(); + $this->tags_id = new ArrayCollection(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function getUuid(): ?string + { + return $this->uuid; + } + + public function setUuid(string $uuid): static + { + $this->uuid = $uuid; + + return $this; + } + + public function getName(): ?string + { + return $this->name; + } + + public function setName(string $name): static + { + $this->name = $name; + + return $this; + } + + public function getCode(): ?string + { + return $this->code; + } + + public function setCode(string $code): static + { + $this->code = $code; + + return $this; + } + + public function isActive(): ?bool + { + return $this->active; + } + + public function setActive(bool $active): static + { + $this->active = $active; + + return $this; + } + + public function getSort(): ?int + { + return $this->sort; + } + + public function setSort(int $sort): static + { + $this->sort = $sort; + + return $this; + } + + public function getCreateAt(): ?\DateTimeImmutable + { + return $this->create_at; + } + + public function setCreateAt(\DateTimeImmutable $create_at): static + { + $this->create_at = $create_at; + + return $this; + } + + public function getUpdateAt(): ?\DateTimeInterface + { + return $this->update_at; + } + + public function setUpdateAt(\DateTimeInterface $update_at): static + { + $this->update_at = $update_at; + + return $this; + } + + public function getCoordinates(): array + { + return $this->coordinates; + } + + public function setCoordinates(array $coordinates): static + { + $this->coordinates = $coordinates; + + return $this; + } + + public function getTypeId(): ?RestauranTypes + { + return $this->type_id; + } + + public function setTypeId(?RestauranTypes $type_id): static + { + $this->type_id = $type_id; + + return $this; + } + + public function getSettlementId(): ?Settlements + { + return $this->settlement_id; + } + + public function setSettlementId(?Settlements $settlement_id): static + { + $this->settlement_id = $settlement_id; + + return $this; + } + + public function getDescription(): ?string + { + return $this->description; + } + + public function setDescription(?string $description): static + { + $this->description = $description; + + return $this; + } + + public function getRecipe(): ?string + { + return $this->recipe; + } + + public function setRecipe(?string $recipe): static + { + $this->recipe = $recipe; + + return $this; + } + + public function getRecipeInfo(): ?string + { + return $this->recipe_info; + } + + public function setRecipeInfo(string $recipe_info): static + { + $this->recipe_info = $recipe_info; + + return $this; + } + + /** + * @return Collection + */ + public function getKitchensId(): Collection + { + return $this->kitchens_id; + } + + public function addKitchensId(Kitchens $kitchensId): static + { + if (!$this->kitchens_id->contains($kitchensId)) { + $this->kitchens_id->add($kitchensId); + } + + return $this; + } + + public function removeKitchensId(Kitchens $kitchensId): static + { + $this->kitchens_id->removeElement($kitchensId); + + return $this; + } + + /** + * @return Collection + */ + public function getPhonesId(): Collection + { + return $this->phones_id; + } + + public function addPhonesId(Phone $phonesId): static + { + if (!$this->phones_id->contains($phonesId)) { + $this->phones_id->add($phonesId); + $phonesId->setRestaurantId($this); + } + + return $this; + } + + public function removePhonesId(Phone $phonesId): static + { + if ($this->phones_id->removeElement($phonesId)) { + // set the owning side to null (unless already changed) + if ($phonesId->getRestaurantId() === $this) { + $phonesId->setRestaurantId(null); + } + } + + return $this; + } + + /** + * @return Collection + */ + public function getEmailsId(): Collection + { + return $this->emails_id; + } + + public function addEmailsId(Email $emailsId): static + { + if (!$this->emails_id->contains($emailsId)) { + $this->emails_id->add($emailsId); + $emailsId->setRestaurantId($this); + } + + return $this; + } + + public function removeEmailsId(Email $emailsId): static + { + if ($this->emails_id->removeElement($emailsId)) { + // set the owning side to null (unless already changed) + if ($emailsId->getRestaurantId() === $this) { + $emailsId->setRestaurantId(null); + } + } + + return $this; + } + + /** + * @return Collection + */ + public function getAddressesId(): Collection + { + return $this->addresses_id; + } + + public function addAddressesId(Address $addressesId): static + { + if (!$this->addresses_id->contains($addressesId)) { + $this->addresses_id->add($addressesId); + $addressesId->setRestaurantId($this); + } + + return $this; + } + + public function removeAddressesId(Address $addressesId): static + { + if ($this->addresses_id->removeElement($addressesId)) { + // set the owning side to null (unless already changed) + if ($addressesId->getRestaurantId() === $this) { + $addressesId->setRestaurantId(null); + } + } + + return $this; + } + + /** + * @return Collection + */ + public function getTagsId(): Collection + { + return $this->tags_id; + } + + public function addTagsId(Tags $tagsId): static + { + if (!$this->tags_id->contains($tagsId)) { + $this->tags_id->add($tagsId); + $tagsId->addRestaurantId($this); + } + + return $this; + } + + public function removeTagsId(Tags $tagsId): static + { + if ($this->tags_id->removeElement($tagsId)) { + $tagsId->removeRestaurantId($this); + } + + return $this; + } + + public function getSite(): ?string + { + return $this->site; + } + + public function setSite(?string $site): static + { + $this->site = $site; + + return $this; + } + + public function getPreviewImage(): ?string + { + return $this->preview_image; + } + + public function setPreviewImage(?string $preview_image): static + { + $this->preview_image = $preview_image; + + return $this; + } + + public function getDetailImage(): ?string + { + return $this->detail_image; + } + + public function setDetailImage(string $detail_image): static + { + $this->detail_image = $detail_image; + + return $this; + } + + public function getHowToFind(): ?string + { + return $this->how_to_find; + } + + public function setHowToFind(?string $how_to_find): static + { + $this->how_to_find = $how_to_find; + + return $this; + } +} + diff --git a/app/src/Entity/Settlements.php b/app/src/Entity/Settlements.php new file mode 100644 index 0000000..2f32614 --- /dev/null +++ b/app/src/Entity/Settlements.php @@ -0,0 +1,154 @@ + + */ + #[ORM\OneToMany(targetEntity: Restaurants::class, mappedBy: 'settlement_id')] + private Collection $restaurant_id; + + public function __construct() + { + $this->restaurant_id = new ArrayCollection(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function getUuid(): ?string + { + return $this->uuid; + } + + public function setUuid(string $uuid): static + { + $this->uuid = $uuid; + + return $this; + } + + public function getName(): ?string + { + return $this->name; + } + + public function setName(string $name): static + { + $this->name = $name; + + return $this; + } + + public function getCode(): ?string + { + return $this->code; + } + + public function setCode(string $code): static + { + $this->code = $code; + + return $this; + } + + public function getCoordinates(): array + { + return $this->coordinates; + } + + public function setCoordinates(array $coordinates): static + { + $this->coordinates = $coordinates; + + return $this; + } + + public function getCreateAt(): ?\DateTimeImmutable + { + return $this->create_at; + } + + public function setCreateAt(\DateTimeImmutable $create_at): static + { + $this->create_at = $create_at; + + return $this; + } + + public function getUpdateAt(): ?\DateTimeInterface + { + return $this->update_at; + } + + public function setUpdateAt(\DateTimeInterface $update_at): static + { + $this->update_at = $update_at; + + return $this; + } + + /** + * @return Collection + */ + public function getRestaurantId(): Collection + { + return $this->restaurant_id; + } + + public function addRestaurantId(Restaurants $restaurantId): static + { + if (!$this->restaurant_id->contains($restaurantId)) { + $this->restaurant_id->add($restaurantId); + $restaurantId->setSettlementId($this); + } + + return $this; + } + + public function removeRestaurantId(Restaurants $restaurantId): static + { + if ($this->restaurant_id->removeElement($restaurantId)) { + // set the owning side to null (unless already changed) + if ($restaurantId->getSettlementId() === $this) { + $restaurantId->setSettlementId(null); + } + } + + return $this; + } +} diff --git a/app/src/Entity/Tags.php b/app/src/Entity/Tags.php new file mode 100644 index 0000000..ceb5f6a --- /dev/null +++ b/app/src/Entity/Tags.php @@ -0,0 +1,72 @@ + + */ + #[ORM\ManyToMany(targetEntity: Restaurants::class, inversedBy: 'tags_id')] + private Collection $restaurant_id; + + #[ORM\Column(length: 255)] + private ?string $name = null; + + public function __construct() + { + $this->restaurant_id = new ArrayCollection(); + } + + public function getId(): ?int + { + return $this->id; + } + + /** + * @return Collection + */ + public function getRestaurantId(): Collection + { + return $this->restaurant_id; + } + + public function addRestaurantId(Restaurants $restaurantId): static + { + if (!$this->restaurant_id->contains($restaurantId)) { + $this->restaurant_id->add($restaurantId); + } + + return $this; + } + + public function removeRestaurantId(Restaurants $restaurantId): static + { + $this->restaurant_id->removeElement($restaurantId); + + return $this; + } + + public function getName(): ?string + { + return $this->name; + } + + public function setName(string $name): static + { + $this->name = $name; + + return $this; + } +} diff --git a/app/src/Entity/Users.php b/app/src/Entity/Users.php new file mode 100644 index 0000000..e76741d --- /dev/null +++ b/app/src/Entity/Users.php @@ -0,0 +1,221 @@ + + */ + #[ORM\OneToMany(targetEntity: NewsComments::class, mappedBy: 'moderator_id')] + private Collection $news_comments_id_moderate; + + /** + * @var Collection + */ + #[ORM\OneToMany(targetEntity: NewsComments::class, mappedBy: 'user_id')] + private Collection $news_comments_id_comment; + + public function __construct() + { + $this->news_comments_id_moderate = new ArrayCollection(); + $this->news_comments_id_comment = new ArrayCollection(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function getUuid(): ?string + { + return $this->uuid; + } + + public function setUuid(string $uuid): static + { + $this->uuid = $uuid; + + return $this; + } + + public function getName(): ?string + { + return $this->name; + } + + public function setName(string $name): static + { + $this->name = $name; + + return $this; + } + + public function isMale(): ?bool + { + return $this->isMale; + } + + public function setMale(bool $isMale): static + { + $this->isMale = $isMale; + + return $this; + } + + public function getBirthDay(): ?\DateTimeImmutable + { + return $this->birthDay; + } + + public function setBirthDay(?\DateTimeImmutable $birthDay): static + { + $this->birthDay = $birthDay; + + return $this; + } + + public function get�ф�address(): ?string + { + return $this->�ф�address; + } + + public function set�ф�address(string $�ф�address): static + { + $this->�ф�address = $�ф�address; + + return $this; + } + + public function getSurname(): ?string + { + return $this->surname; + } + + public function setSurname(string $surname): static + { + $this->surname = $surname; + + return $this; + } + + public function getPhoneNumber(): ?string + { + return $this->phone_number; + } + + public function setPhoneNumber(?string $phone_number): static + { + $this->phone_number = $phone_number; + + return $this; + } + + public function getEmail(): ?string + { + return $this->email; + } + + public function setEmail(?string $email): static + { + $this->email = $email; + + return $this; + } + + /** + * @return Collection + */ + public function getNewsCommentsIdModerate(): Collection + { + return $this->news_comments_id_moderate; + } + + public function addNewsCommentsIdModerate(NewsComments $newsCommentsIdModerate): static + { + if (!$this->news_comments_id_moderate->contains($newsCommentsIdModerate)) { + $this->news_comments_id_moderate->add($newsCommentsIdModerate); + $newsCommentsIdModerate->setModeratorId($this); + } + + return $this; + } + + public function removeNewsCommentsIdModerate(NewsComments $newsCommentsIdModerate): static + { + if ($this->news_comments_id_moderate->removeElement($newsCommentsIdModerate)) { + // set the owning side to null (unless already changed) + if ($newsCommentsIdModerate->getModeratorId() === $this) { + $newsCommentsIdModerate->setModeratorId(null); + } + } + + return $this; + } + + /** + * @return Collection + */ + public function getNewsCommentsIdComment(): Collection + { + return $this->news_comments_id_comment; + } + + public function addNewsCommentsIdComment(NewsComments $newsCommentsIdComment): static + { + if (!$this->news_comments_id_comment->contains($newsCommentsIdComment)) { + $this->news_comments_id_comment->add($newsCommentsIdComment); + $newsCommentsIdComment->setUserId($this); + } + + return $this; + } + + public function removeNewsCommentsIdComment(NewsComments $newsCommentsIdComment): static + { + if ($this->news_comments_id_comment->removeElement($newsCommentsIdComment)) { + // set the owning side to null (unless already changed) + if ($newsCommentsIdComment->getUserId() === $this) { + $newsCommentsIdComment->setUserId(null); + } + } + + return $this; + } +} diff --git a/app/src/Repository/AddressRepository.php b/app/src/Repository/AddressRepository.php new file mode 100644 index 0000000..e87117f --- /dev/null +++ b/app/src/Repository/AddressRepository.php @@ -0,0 +1,48 @@ + + * + * @method Address|null find($id, $lockMode = null, $lockVersion = null) + * @method Address|null findOneBy(array $criteria, array $orderBy = null) + * @method Address[] findAll() + * @method Address[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class AddressRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Address::class); + } + +// /** +// * @return Address[] Returns an array of Address objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('a') +// ->andWhere('a.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('a.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?Address +// { +// return $this->createQueryBuilder('a') +// ->andWhere('a.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/app/src/Repository/EmailRepository.php b/app/src/Repository/EmailRepository.php new file mode 100644 index 0000000..f22b0ee --- /dev/null +++ b/app/src/Repository/EmailRepository.php @@ -0,0 +1,48 @@ + + * + * @method Email|null find($id, $lockMode = null, $lockVersion = null) + * @method Email|null findOneBy(array $criteria, array $orderBy = null) + * @method Email[] findAll() + * @method Email[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class EmailRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Email::class); + } + +// /** +// * @return Email[] Returns an array of Email objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('e') +// ->andWhere('e.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('e.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?Email +// { +// return $this->createQueryBuilder('e') +// ->andWhere('e.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/app/src/Repository/KitchensRepository.php b/app/src/Repository/KitchensRepository.php new file mode 100644 index 0000000..47ef7fa --- /dev/null +++ b/app/src/Repository/KitchensRepository.php @@ -0,0 +1,48 @@ + + * + * @method Kitchens|null find($id, $lockMode = null, $lockVersion = null) + * @method Kitchens|null findOneBy(array $criteria, array $orderBy = null) + * @method Kitchens[] findAll() + * @method Kitchens[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class KitchensRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Kitchens::class); + } + +// /** +// * @return Kitchens[] Returns an array of Kitchens objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('k') +// ->andWhere('k.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('k.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?Kitchens +// { +// return $this->createQueryBuilder('k') +// ->andWhere('k.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/app/src/Repository/NewsCategoriesRepository.php b/app/src/Repository/NewsCategoriesRepository.php new file mode 100644 index 0000000..46c102e --- /dev/null +++ b/app/src/Repository/NewsCategoriesRepository.php @@ -0,0 +1,48 @@ + + * + * @method NewsCategories|null find($id, $lockMode = null, $lockVersion = null) + * @method NewsCategories|null findOneBy(array $criteria, array $orderBy = null) + * @method NewsCategories[] findAll() + * @method NewsCategories[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class NewsCategoriesRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, NewsCategories::class); + } + +// /** +// * @return NewsCategories[] Returns an array of NewsCategories objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('n') +// ->andWhere('n.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('n.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?NewsCategories +// { +// return $this->createQueryBuilder('n') +// ->andWhere('n.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/app/src/Repository/NewsCommentsRepository.php b/app/src/Repository/NewsCommentsRepository.php new file mode 100644 index 0000000..9bf4cd0 --- /dev/null +++ b/app/src/Repository/NewsCommentsRepository.php @@ -0,0 +1,48 @@ + + * + * @method NewsComments|null find($id, $lockMode = null, $lockVersion = null) + * @method NewsComments|null findOneBy(array $criteria, array $orderBy = null) + * @method NewsComments[] findAll() + * @method NewsComments[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class NewsCommentsRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, NewsComments::class); + } + +// /** +// * @return NewsComments[] Returns an array of NewsComments objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('n') +// ->andWhere('n.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('n.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?NewsComments +// { +// return $this->createQueryBuilder('n') +// ->andWhere('n.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/app/src/Repository/NewsRepository.php b/app/src/Repository/NewsRepository.php new file mode 100644 index 0000000..3b5d864 --- /dev/null +++ b/app/src/Repository/NewsRepository.php @@ -0,0 +1,48 @@ + + * + * @method News|null find($id, $lockMode = null, $lockVersion = null) + * @method News|null findOneBy(array $criteria, array $orderBy = null) + * @method News[] findAll() + * @method News[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class NewsRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, News::class); + } + +// /** +// * @return News[] Returns an array of News objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('n') +// ->andWhere('n.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('n.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?News +// { +// return $this->createQueryBuilder('n') +// ->andWhere('n.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/app/src/Repository/NewsTypeRepository.php b/app/src/Repository/NewsTypeRepository.php new file mode 100644 index 0000000..385998b --- /dev/null +++ b/app/src/Repository/NewsTypeRepository.php @@ -0,0 +1,48 @@ + + * + * @method NewsType|null find($id, $lockMode = null, $lockVersion = null) + * @method NewsType|null findOneBy(array $criteria, array $orderBy = null) + * @method NewsType[] findAll() + * @method NewsType[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class NewsTypeRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, NewsType::class); + } + +// /** +// * @return NewsType[] Returns an array of NewsType objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('n') +// ->andWhere('n.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('n.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?NewsType +// { +// return $this->createQueryBuilder('n') +// ->andWhere('n.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/app/src/Repository/PhoneRepository.php b/app/src/Repository/PhoneRepository.php new file mode 100644 index 0000000..de389d6 --- /dev/null +++ b/app/src/Repository/PhoneRepository.php @@ -0,0 +1,48 @@ + + * + * @method Phone|null find($id, $lockMode = null, $lockVersion = null) + * @method Phone|null findOneBy(array $criteria, array $orderBy = null) + * @method Phone[] findAll() + * @method Phone[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class PhoneRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Phone::class); + } + +// /** +// * @return Phone[] Returns an array of Phone objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('p') +// ->andWhere('p.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('p.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?Phone +// { +// return $this->createQueryBuilder('p') +// ->andWhere('p.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/app/src/Repository/RestauranTypesRepository.php b/app/src/Repository/RestauranTypesRepository.php new file mode 100644 index 0000000..fd67ecb --- /dev/null +++ b/app/src/Repository/RestauranTypesRepository.php @@ -0,0 +1,48 @@ + + * + * @method RestauranTypes|null find($id, $lockMode = null, $lockVersion = null) + * @method RestauranTypes|null findOneBy(array $criteria, array $orderBy = null) + * @method RestauranTypes[] findAll() + * @method RestauranTypes[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class RestauranTypesRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, RestauranTypes::class); + } + +// /** +// * @return RestauranTypes[] Returns an array of RestauranTypes objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('r') +// ->andWhere('r.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('r.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?RestauranTypes +// { +// return $this->createQueryBuilder('r') +// ->andWhere('r.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/app/src/Repository/RestaurantsRepository.php b/app/src/Repository/RestaurantsRepository.php new file mode 100644 index 0000000..f540695 --- /dev/null +++ b/app/src/Repository/RestaurantsRepository.php @@ -0,0 +1,48 @@ + + * + * @method Restaurants|null find($id, $lockMode = null, $lockVersion = null) + * @method Restaurants|null findOneBy(array $criteria, array $orderBy = null) + * @method Restaurants[] findAll() + * @method Restaurants[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class RestaurantsRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Restaurants::class); + } + +// /** +// * @return Restaurants[] Returns an array of Restaurants objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('r') +// ->andWhere('r.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('r.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?Restaurants +// { +// return $this->createQueryBuilder('r') +// ->andWhere('r.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/app/src/Repository/SettlementsRepository.php b/app/src/Repository/SettlementsRepository.php new file mode 100644 index 0000000..ff6673b --- /dev/null +++ b/app/src/Repository/SettlementsRepository.php @@ -0,0 +1,48 @@ + + * + * @method Settlements|null find($id, $lockMode = null, $lockVersion = null) + * @method Settlements|null findOneBy(array $criteria, array $orderBy = null) + * @method Settlements[] findAll() + * @method Settlements[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class SettlementsRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Settlements::class); + } + +// /** +// * @return Settlements[] Returns an array of Settlements objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('s') +// ->andWhere('s.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('s.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?Settlements +// { +// return $this->createQueryBuilder('s') +// ->andWhere('s.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/app/src/Repository/TagsRepository.php b/app/src/Repository/TagsRepository.php new file mode 100644 index 0000000..4f01463 --- /dev/null +++ b/app/src/Repository/TagsRepository.php @@ -0,0 +1,48 @@ + + * + * @method Tags|null find($id, $lockMode = null, $lockVersion = null) + * @method Tags|null findOneBy(array $criteria, array $orderBy = null) + * @method Tags[] findAll() + * @method Tags[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class TagsRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Tags::class); + } + +// /** +// * @return Tags[] Returns an array of Tags objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('t') +// ->andWhere('t.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('t.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?Tags +// { +// return $this->createQueryBuilder('t') +// ->andWhere('t.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/app/src/Repository/UsersRepository.php b/app/src/Repository/UsersRepository.php new file mode 100644 index 0000000..c794b38 --- /dev/null +++ b/app/src/Repository/UsersRepository.php @@ -0,0 +1,48 @@ + + * + * @method Users|null find($id, $lockMode = null, $lockVersion = null) + * @method Users|null findOneBy(array $criteria, array $orderBy = null) + * @method Users[] findAll() + * @method Users[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class UsersRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Users::class); + } + +// /** +// * @return Users[] Returns an array of Users objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('u') +// ->andWhere('u.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('u.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?Users +// { +// return $this->createQueryBuilder('u') +// ->andWhere('u.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/app/templates/news_types/index.html.twig b/app/templates/news_types/index.html.twig new file mode 100644 index 0000000..310cc3a --- /dev/null +++ b/app/templates/news_types/index.html.twig @@ -0,0 +1,20 @@ +{% extends 'base.html.twig' %} + +{% block title %}Hello NewsTypesController!{% endblock %} + +{% block body %} + + +
+

Hello {{ controller_name }}! ✅

+ + This friendly message is coming from: +
    +
  • Your controller at /home/tamanit/myProj/iqdevTranningProgram/app/src/Controller/NewsTypesController.php
  • +
  • Your template at /home/tamanit/myProj/iqdevTranningProgram/app/templates/news_types/index.html.twig
  • +
+
+{% endblock %} diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 3b3b271..111db6b 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,11 +1,21 @@ version: '3.1' services: + app: + build: + context: ../ + dockerfile: docker/php/Dockerfile + networks: + - app + depends_on: + - db + db: image: postgres:16.2 environment: POSTGRES_PASSWORD: ${DATABASE_PASSWORD} POSTGRES_USER: ${DATABASE_USER} + POSTGRES_DB: ${DATABASE_NAME} networks: - app ports: @@ -25,15 +35,6 @@ services: depends_on: - app - app: - build: - context: ../ - dockerfile: docker/php/Dockerfile - networks: - - app - depends_on: - - db - networks: app: driver: bridge \ No newline at end of file -- GitLab From fd431552570225a2180e3f61baca21910f1152bc Mon Sep 17 00:00:00 2001 From: "Alex. Plokhikh" Date: Mon, 22 Apr 2024 10:36:39 +0500 Subject: [PATCH 02/14] STA-959|rm .idea again --- .idea/.gitignore | 8 - .idea/iqdevTranningProgram.iml | 141 ---------------- .idea/modules.xml | 8 - .idea/php.xml | 158 ------------------ .idea/phpunit.xml | 10 -- .../0e61f67641b441bb3ee38e903c594d99cafa14b4 | 2 - .../11fc5ee351c0edf973b3158acd40705a072901f7 | 0 .../7c103dcd8c0314a8821f84f7886754511983a720 | 2 - .../dacdf19231dacf48f340f1ddb51182a025c0e074 | 0 .idea/sonarlint/issuestore/index.pb | 11 -- .../0e61f67641b441bb3ee38e903c594d99cafa14b4 | 0 .../11fc5ee351c0edf973b3158acd40705a072901f7 | 0 .../7c103dcd8c0314a8821f84f7886754511983a720 | 0 .../dacdf19231dacf48f340f1ddb51182a025c0e074 | 0 .idea/sonarlint/securityhotspotstore/index.pb | 11 -- .idea/symfony2.xml | 7 - .idea/vcs.xml | 6 - 17 files changed, 364 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/iqdevTranningProgram.iml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/php.xml delete mode 100644 .idea/phpunit.xml delete mode 100644 .idea/sonarlint/issuestore/0/e/0e61f67641b441bb3ee38e903c594d99cafa14b4 delete mode 100644 .idea/sonarlint/issuestore/1/1/11fc5ee351c0edf973b3158acd40705a072901f7 delete mode 100644 .idea/sonarlint/issuestore/7/c/7c103dcd8c0314a8821f84f7886754511983a720 delete mode 100644 .idea/sonarlint/issuestore/d/a/dacdf19231dacf48f340f1ddb51182a025c0e074 delete mode 100644 .idea/sonarlint/issuestore/index.pb delete mode 100644 .idea/sonarlint/securityhotspotstore/0/e/0e61f67641b441bb3ee38e903c594d99cafa14b4 delete mode 100644 .idea/sonarlint/securityhotspotstore/1/1/11fc5ee351c0edf973b3158acd40705a072901f7 delete mode 100644 .idea/sonarlint/securityhotspotstore/7/c/7c103dcd8c0314a8821f84f7886754511983a720 delete mode 100644 .idea/sonarlint/securityhotspotstore/d/a/dacdf19231dacf48f340f1ddb51182a025c0e074 delete mode 100644 .idea/sonarlint/securityhotspotstore/index.pb delete mode 100644 .idea/symfony2.xml delete mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 13566b8..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/.idea/iqdevTranningProgram.iml b/.idea/iqdevTranningProgram.iml deleted file mode 100644 index 54d8720..0000000 --- a/.idea/iqdevTranningProgram.iml +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index aedf51d..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/php.xml b/.idea/php.xml deleted file mode 100644 index 762b2df..0000000 --- a/.idea/php.xml +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/phpunit.xml b/.idea/phpunit.xml deleted file mode 100644 index 4f8104c..0000000 --- a/.idea/phpunit.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/sonarlint/issuestore/0/e/0e61f67641b441bb3ee38e903c594d99cafa14b4 b/.idea/sonarlint/issuestore/0/e/0e61f67641b441bb3ee38e903c594d99cafa14b4 deleted file mode 100644 index ef18277..0000000 --- a/.idea/sonarlint/issuestore/0/e/0e61f67641b441bb3ee38e903c594d99cafa14b4 +++ /dev/null @@ -1,2 +0,0 @@ - -f php:S4833"QReplace "require_once" with namespace import mechanism through the "use" keyword.(է \ No newline at end of file diff --git a/.idea/sonarlint/issuestore/1/1/11fc5ee351c0edf973b3158acd40705a072901f7 b/.idea/sonarlint/issuestore/1/1/11fc5ee351c0edf973b3158acd40705a072901f7 deleted file mode 100644 index e69de29..0000000 diff --git a/.idea/sonarlint/issuestore/7/c/7c103dcd8c0314a8821f84f7886754511983a720 b/.idea/sonarlint/issuestore/7/c/7c103dcd8c0314a8821f84f7886754511983a720 deleted file mode 100644 index 49baffe..0000000 --- a/.idea/sonarlint/issuestore/7/c/7c103dcd8c0314a8821f84f7886754511983a720 +++ /dev/null @@ -1,2 +0,0 @@ - -php:S112"FDefine and throw a dedicated exception instead of using a generic one.(ޖ81J$639b0b04-18e2-4d6f-b884-25955f0cf69c \ No newline at end of file diff --git a/.idea/sonarlint/issuestore/d/a/dacdf19231dacf48f340f1ddb51182a025c0e074 b/.idea/sonarlint/issuestore/d/a/dacdf19231dacf48f340f1ddb51182a025c0e074 deleted file mode 100644 index e69de29..0000000 diff --git a/.idea/sonarlint/issuestore/index.pb b/.idea/sonarlint/issuestore/index.pb deleted file mode 100644 index 952c8a6..0000000 --- a/.idea/sonarlint/issuestore/index.pb +++ /dev/null @@ -1,11 +0,0 @@ - -_ -/src/Controller/ReadFileLineByLineController.php,1/1/11fc5ee351c0edf973b3158acd40705a072901f7 -F -public/HelloWorld.html,d/a/dacdf19231dacf48f340f1ddb51182a025c0e074 -@ -public/index.php,0/e/0e61f67641b441bb3ee38e903c594d99cafa14b4 -_ -/src/Repository/ReadFileLineByLineRepository.php,7/c/7c103dcd8c0314a8821f84f7886754511983a720 -X -(src/Actions/ReadFileLineByLineAction.php,b/b/bb599184d4f741824c29e585018cdb8069747a80 \ No newline at end of file diff --git a/.idea/sonarlint/securityhotspotstore/0/e/0e61f67641b441bb3ee38e903c594d99cafa14b4 b/.idea/sonarlint/securityhotspotstore/0/e/0e61f67641b441bb3ee38e903c594d99cafa14b4 deleted file mode 100644 index e69de29..0000000 diff --git a/.idea/sonarlint/securityhotspotstore/1/1/11fc5ee351c0edf973b3158acd40705a072901f7 b/.idea/sonarlint/securityhotspotstore/1/1/11fc5ee351c0edf973b3158acd40705a072901f7 deleted file mode 100644 index e69de29..0000000 diff --git a/.idea/sonarlint/securityhotspotstore/7/c/7c103dcd8c0314a8821f84f7886754511983a720 b/.idea/sonarlint/securityhotspotstore/7/c/7c103dcd8c0314a8821f84f7886754511983a720 deleted file mode 100644 index e69de29..0000000 diff --git a/.idea/sonarlint/securityhotspotstore/d/a/dacdf19231dacf48f340f1ddb51182a025c0e074 b/.idea/sonarlint/securityhotspotstore/d/a/dacdf19231dacf48f340f1ddb51182a025c0e074 deleted file mode 100644 index e69de29..0000000 diff --git a/.idea/sonarlint/securityhotspotstore/index.pb b/.idea/sonarlint/securityhotspotstore/index.pb deleted file mode 100644 index 952c8a6..0000000 --- a/.idea/sonarlint/securityhotspotstore/index.pb +++ /dev/null @@ -1,11 +0,0 @@ - -_ -/src/Controller/ReadFileLineByLineController.php,1/1/11fc5ee351c0edf973b3158acd40705a072901f7 -F -public/HelloWorld.html,d/a/dacdf19231dacf48f340f1ddb51182a025c0e074 -@ -public/index.php,0/e/0e61f67641b441bb3ee38e903c594d99cafa14b4 -_ -/src/Repository/ReadFileLineByLineRepository.php,7/c/7c103dcd8c0314a8821f84f7886754511983a720 -X -(src/Actions/ReadFileLineByLineAction.php,b/b/bb599184d4f741824c29e585018cdb8069747a80 \ No newline at end of file diff --git a/.idea/symfony2.xml b/.idea/symfony2.xml deleted file mode 100644 index 3298060..0000000 --- a/.idea/symfony2.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 35eb1dd..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file -- GitLab From 7eb59d48579f5fdbf285a28ff7fcaaa06ddb8b9b Mon Sep 17 00:00:00 2001 From: "Alex. Plokhikh" Date: Mon, 22 Apr 2024 10:41:35 +0500 Subject: [PATCH 03/14] STA-959|update gitignore --- .gitignore | 4 ++-- docker/.env | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 docker/.env diff --git a/.gitignore b/.gitignore index 3bf780b..b1c6e6f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -.idea -.env \ No newline at end of file +/.idea/ +/.env \ No newline at end of file diff --git a/docker/.env b/docker/.env new file mode 100644 index 0000000..7169a48 --- /dev/null +++ b/docker/.env @@ -0,0 +1,3 @@ +DATABASE_PASSWORD="root" +DATABASE_USER="root" +DATABASE_NAME="postgres" \ No newline at end of file -- GitLab From 5bcbc4c90941d114e549d9bb2172fb1bd531779e Mon Sep 17 00:00:00 2001 From: "Alex. Plokhikh" Date: Fri, 26 Apr 2024 15:57:17 +0500 Subject: [PATCH 04/14] STA-931|clean struct & add gitignore on .idea --- .gitignore | 3 + .idea/.gitignore | 8 - .idea/iqdevTranningProgram.iml | 141 ---------------- .idea/modules.xml | 8 - .idea/php.xml | 158 ------------------ .idea/phpunit.xml | 10 -- .../0e61f67641b441bb3ee38e903c594d99cafa14b4 | 2 - .../11fc5ee351c0edf973b3158acd40705a072901f7 | 0 .../7c103dcd8c0314a8821f84f7886754511983a720 | 2 - .../dacdf19231dacf48f340f1ddb51182a025c0e074 | 0 .idea/sonarlint/issuestore/index.pb | 11 -- .../0e61f67641b441bb3ee38e903c594d99cafa14b4 | 0 .../11fc5ee351c0edf973b3158acd40705a072901f7 | 0 .../7c103dcd8c0314a8821f84f7886754511983a720 | 0 .../dacdf19231dacf48f340f1ddb51182a025c0e074 | 0 .idea/sonarlint/securityhotspotstore/index.pb | 11 -- .idea/symfony2.xml | 7 - .idea/vcs.xml | 6 - src/Actions/CountFriday13Action.php | 27 --- src/Actions/DiffDaysAction.php | 21 --- src/Actions/HowDaysToNYAction.php | 20 --- src/Actions/IdSearchAction.php | 29 ---- src/Actions/PrepareMenuAction.php | 35 ---- src/Actions/ReadFileLineByLineAction.php | 29 ---- src/Actions/ReadLogFileAction.php | 26 --- src/Actions/SortPriceAction.php | 27 --- src/Actions/UniqElementsAction.php | 16 -- src/Controller/CountFriday13Controller.php | 25 --- src/Controller/DiffDaysController.php | 26 --- src/Controller/HowDaysToNYController.php | 25 --- src/Controller/IdSearchController.php | 24 --- src/Controller/PrepareMenuController.php | 26 --- .../ReadFileLineByLineController.php | 36 ---- src/Controller/ReadLogFileController.php | 29 ---- src/Controller/SortPriceController.php | 24 --- src/Controller/UniqElementsController.php | 19 --- src/Requests/AllFri13Request.php | 21 --- src/Requests/BaseRequest.php | 71 -------- src/Requests/BeforeNYDateRequest.php | 19 --- src/Requests/DiffDaysRequest.php | 29 ---- src/Requests/MenuRequest.php | 32 ---- src/Requests/PricesRequest.php | 42 ----- src/Requests/UniqElementsRequest.php | 21 --- src/Requests/UsersRequest.php | 45 ----- templates/count_friday13/index.html.twig | 20 --- templates/diff_days/index.html.twig | 20 --- templates/how_days_to_ny/index.html.twig | 20 --- templates/prepare_menu/index.html.twig | 20 --- .../read_file_line_by_line/index.html.twig | 20 --- templates/read_log_file/index.html.twig | 20 --- templates/search/index.html.twig | 20 --- templates/sort_price/index.html.twig | 20 --- templates/uniq_elements/index.html.twig | 20 --- 53 files changed, 3 insertions(+), 1288 deletions(-) create mode 100644 .gitignore delete mode 100644 .idea/.gitignore delete mode 100644 .idea/iqdevTranningProgram.iml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/php.xml delete mode 100644 .idea/phpunit.xml delete mode 100644 .idea/sonarlint/issuestore/0/e/0e61f67641b441bb3ee38e903c594d99cafa14b4 delete mode 100644 .idea/sonarlint/issuestore/1/1/11fc5ee351c0edf973b3158acd40705a072901f7 delete mode 100644 .idea/sonarlint/issuestore/7/c/7c103dcd8c0314a8821f84f7886754511983a720 delete mode 100644 .idea/sonarlint/issuestore/d/a/dacdf19231dacf48f340f1ddb51182a025c0e074 delete mode 100644 .idea/sonarlint/issuestore/index.pb delete mode 100644 .idea/sonarlint/securityhotspotstore/0/e/0e61f67641b441bb3ee38e903c594d99cafa14b4 delete mode 100644 .idea/sonarlint/securityhotspotstore/1/1/11fc5ee351c0edf973b3158acd40705a072901f7 delete mode 100644 .idea/sonarlint/securityhotspotstore/7/c/7c103dcd8c0314a8821f84f7886754511983a720 delete mode 100644 .idea/sonarlint/securityhotspotstore/d/a/dacdf19231dacf48f340f1ddb51182a025c0e074 delete mode 100644 .idea/sonarlint/securityhotspotstore/index.pb delete mode 100644 .idea/symfony2.xml delete mode 100644 .idea/vcs.xml delete mode 100644 src/Actions/CountFriday13Action.php delete mode 100644 src/Actions/DiffDaysAction.php delete mode 100644 src/Actions/HowDaysToNYAction.php delete mode 100644 src/Actions/IdSearchAction.php delete mode 100644 src/Actions/PrepareMenuAction.php delete mode 100644 src/Actions/ReadFileLineByLineAction.php delete mode 100644 src/Actions/ReadLogFileAction.php delete mode 100644 src/Actions/SortPriceAction.php delete mode 100644 src/Actions/UniqElementsAction.php delete mode 100644 src/Controller/CountFriday13Controller.php delete mode 100644 src/Controller/DiffDaysController.php delete mode 100644 src/Controller/HowDaysToNYController.php delete mode 100644 src/Controller/IdSearchController.php delete mode 100644 src/Controller/PrepareMenuController.php delete mode 100644 src/Controller/ReadFileLineByLineController.php delete mode 100644 src/Controller/ReadLogFileController.php delete mode 100644 src/Controller/SortPriceController.php delete mode 100644 src/Controller/UniqElementsController.php delete mode 100644 src/Requests/AllFri13Request.php delete mode 100644 src/Requests/BaseRequest.php delete mode 100644 src/Requests/BeforeNYDateRequest.php delete mode 100644 src/Requests/DiffDaysRequest.php delete mode 100644 src/Requests/MenuRequest.php delete mode 100644 src/Requests/PricesRequest.php delete mode 100644 src/Requests/UniqElementsRequest.php delete mode 100644 src/Requests/UsersRequest.php delete mode 100644 templates/count_friday13/index.html.twig delete mode 100644 templates/diff_days/index.html.twig delete mode 100644 templates/how_days_to_ny/index.html.twig delete mode 100644 templates/prepare_menu/index.html.twig delete mode 100644 templates/read_file_line_by_line/index.html.twig delete mode 100644 templates/read_log_file/index.html.twig delete mode 100644 templates/search/index.html.twig delete mode 100644 templates/sort_price/index.html.twig delete mode 100644 templates/uniq_elements/index.html.twig diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d059396 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# --- block jetbrains files --- +.idea/ +# ----------------------------- diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 13566b8..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/.idea/iqdevTranningProgram.iml b/.idea/iqdevTranningProgram.iml deleted file mode 100644 index 54d8720..0000000 --- a/.idea/iqdevTranningProgram.iml +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index aedf51d..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/php.xml b/.idea/php.xml deleted file mode 100644 index 762b2df..0000000 --- a/.idea/php.xml +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/phpunit.xml b/.idea/phpunit.xml deleted file mode 100644 index 4f8104c..0000000 --- a/.idea/phpunit.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/sonarlint/issuestore/0/e/0e61f67641b441bb3ee38e903c594d99cafa14b4 b/.idea/sonarlint/issuestore/0/e/0e61f67641b441bb3ee38e903c594d99cafa14b4 deleted file mode 100644 index ef18277..0000000 --- a/.idea/sonarlint/issuestore/0/e/0e61f67641b441bb3ee38e903c594d99cafa14b4 +++ /dev/null @@ -1,2 +0,0 @@ - -f php:S4833"QReplace "require_once" with namespace import mechanism through the "use" keyword.(է \ No newline at end of file diff --git a/.idea/sonarlint/issuestore/1/1/11fc5ee351c0edf973b3158acd40705a072901f7 b/.idea/sonarlint/issuestore/1/1/11fc5ee351c0edf973b3158acd40705a072901f7 deleted file mode 100644 index e69de29..0000000 diff --git a/.idea/sonarlint/issuestore/7/c/7c103dcd8c0314a8821f84f7886754511983a720 b/.idea/sonarlint/issuestore/7/c/7c103dcd8c0314a8821f84f7886754511983a720 deleted file mode 100644 index 49baffe..0000000 --- a/.idea/sonarlint/issuestore/7/c/7c103dcd8c0314a8821f84f7886754511983a720 +++ /dev/null @@ -1,2 +0,0 @@ - -php:S112"FDefine and throw a dedicated exception instead of using a generic one.(ޖ81J$639b0b04-18e2-4d6f-b884-25955f0cf69c \ No newline at end of file diff --git a/.idea/sonarlint/issuestore/d/a/dacdf19231dacf48f340f1ddb51182a025c0e074 b/.idea/sonarlint/issuestore/d/a/dacdf19231dacf48f340f1ddb51182a025c0e074 deleted file mode 100644 index e69de29..0000000 diff --git a/.idea/sonarlint/issuestore/index.pb b/.idea/sonarlint/issuestore/index.pb deleted file mode 100644 index 952c8a6..0000000 --- a/.idea/sonarlint/issuestore/index.pb +++ /dev/null @@ -1,11 +0,0 @@ - -_ -/src/Controller/ReadFileLineByLineController.php,1/1/11fc5ee351c0edf973b3158acd40705a072901f7 -F -public/HelloWorld.html,d/a/dacdf19231dacf48f340f1ddb51182a025c0e074 -@ -public/index.php,0/e/0e61f67641b441bb3ee38e903c594d99cafa14b4 -_ -/src/Repository/ReadFileLineByLineRepository.php,7/c/7c103dcd8c0314a8821f84f7886754511983a720 -X -(src/Actions/ReadFileLineByLineAction.php,b/b/bb599184d4f741824c29e585018cdb8069747a80 \ No newline at end of file diff --git a/.idea/sonarlint/securityhotspotstore/0/e/0e61f67641b441bb3ee38e903c594d99cafa14b4 b/.idea/sonarlint/securityhotspotstore/0/e/0e61f67641b441bb3ee38e903c594d99cafa14b4 deleted file mode 100644 index e69de29..0000000 diff --git a/.idea/sonarlint/securityhotspotstore/1/1/11fc5ee351c0edf973b3158acd40705a072901f7 b/.idea/sonarlint/securityhotspotstore/1/1/11fc5ee351c0edf973b3158acd40705a072901f7 deleted file mode 100644 index e69de29..0000000 diff --git a/.idea/sonarlint/securityhotspotstore/7/c/7c103dcd8c0314a8821f84f7886754511983a720 b/.idea/sonarlint/securityhotspotstore/7/c/7c103dcd8c0314a8821f84f7886754511983a720 deleted file mode 100644 index e69de29..0000000 diff --git a/.idea/sonarlint/securityhotspotstore/d/a/dacdf19231dacf48f340f1ddb51182a025c0e074 b/.idea/sonarlint/securityhotspotstore/d/a/dacdf19231dacf48f340f1ddb51182a025c0e074 deleted file mode 100644 index e69de29..0000000 diff --git a/.idea/sonarlint/securityhotspotstore/index.pb b/.idea/sonarlint/securityhotspotstore/index.pb deleted file mode 100644 index 952c8a6..0000000 --- a/.idea/sonarlint/securityhotspotstore/index.pb +++ /dev/null @@ -1,11 +0,0 @@ - -_ -/src/Controller/ReadFileLineByLineController.php,1/1/11fc5ee351c0edf973b3158acd40705a072901f7 -F -public/HelloWorld.html,d/a/dacdf19231dacf48f340f1ddb51182a025c0e074 -@ -public/index.php,0/e/0e61f67641b441bb3ee38e903c594d99cafa14b4 -_ -/src/Repository/ReadFileLineByLineRepository.php,7/c/7c103dcd8c0314a8821f84f7886754511983a720 -X -(src/Actions/ReadFileLineByLineAction.php,b/b/bb599184d4f741824c29e585018cdb8069747a80 \ No newline at end of file diff --git a/.idea/symfony2.xml b/.idea/symfony2.xml deleted file mode 100644 index 3298060..0000000 --- a/.idea/symfony2.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 35eb1dd..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/Actions/CountFriday13Action.php b/src/Actions/CountFriday13Action.php deleted file mode 100644 index c7986cd..0000000 --- a/src/Actions/CountFriday13Action.php +++ /dev/null @@ -1,27 +0,0 @@ -setDate($year, $i, 13); - - if ($next13->format("D") === "Fri") { - $AllFri13[] = $next13; - } - } - return $AllFri13; - } -} diff --git a/src/Actions/DiffDaysAction.php b/src/Actions/DiffDaysAction.php deleted file mode 100644 index c3ee3c2..0000000 --- a/src/Actions/DiffDaysAction.php +++ /dev/null @@ -1,21 +0,0 @@ -diff($dateEnd)->format('%a'); - } -} diff --git a/src/Actions/HowDaysToNYAction.php b/src/Actions/HowDaysToNYAction.php deleted file mode 100644 index 3c133ed..0000000 --- a/src/Actions/HowDaysToNYAction.php +++ /dev/null @@ -1,20 +0,0 @@ -modify('first day of Jan +1 year'); - - return (int) $dateOfNY->diff($date)->format('%a'); - } -} \ No newline at end of file diff --git a/src/Actions/IdSearchAction.php b/src/Actions/IdSearchAction.php deleted file mode 100644 index 6953291..0000000 --- a/src/Actions/IdSearchAction.php +++ /dev/null @@ -1,29 +0,0 @@ - 30, - * 'name' => 'Jhon', - * 'age' => 23, - * ] - * @param $id - ид искомого элемента - * @return array|null - найденный элемент/ вернет null при его отсутствии - */ - public static function act(array $array): ?array - { - - foreach ($array['users'] as $item){ - if ($item['id'] === $array['id']){ - return $item; - } - } - - return null; - } -} diff --git a/src/Actions/PrepareMenuAction.php b/src/Actions/PrepareMenuAction.php deleted file mode 100644 index 6c81983..0000000 --- a/src/Actions/PrepareMenuAction.php +++ /dev/null @@ -1,35 +0,0 @@ -act($request->serialise())); - } -} diff --git a/src/Controller/DiffDaysController.php b/src/Controller/DiffDaysController.php deleted file mode 100644 index 7dc8cd8..0000000 --- a/src/Controller/DiffDaysController.php +++ /dev/null @@ -1,26 +0,0 @@ -serialise(); - return new JsonResponse($action->act($array['startDate'], $array['endDate'])); - } -} diff --git a/src/Controller/HowDaysToNYController.php b/src/Controller/HowDaysToNYController.php deleted file mode 100644 index 8311dce..0000000 --- a/src/Controller/HowDaysToNYController.php +++ /dev/null @@ -1,25 +0,0 @@ -act($request->serialise())); - } -} diff --git a/src/Controller/IdSearchController.php b/src/Controller/IdSearchController.php deleted file mode 100644 index 3dd1716..0000000 --- a/src/Controller/IdSearchController.php +++ /dev/null @@ -1,24 +0,0 @@ -act($request->serialise())); - } -} \ No newline at end of file diff --git a/src/Controller/PrepareMenuController.php b/src/Controller/PrepareMenuController.php deleted file mode 100644 index 49a74dd..0000000 --- a/src/Controller/PrepareMenuController.php +++ /dev/null @@ -1,26 +0,0 @@ -act($request->serialise())); - } -} diff --git a/src/Controller/ReadFileLineByLineController.php b/src/Controller/ReadFileLineByLineController.php deleted file mode 100644 index c6d0f03..0000000 --- a/src/Controller/ReadFileLineByLineController.php +++ /dev/null @@ -1,36 +0,0 @@ -files->get('File'); - $content = ""; - try{ - foreach ($action->act($file->getRealPath()) as $line) { - $content .= $line; - } - } catch (\Exception $exception) { - return new Response($exception->getMessage(), Response::HTTP_NOT_FOUND); - } - - return new Response($content); - } -} diff --git a/src/Controller/ReadLogFileController.php b/src/Controller/ReadLogFileController.php deleted file mode 100644 index 809cf64..0000000 --- a/src/Controller/ReadLogFileController.php +++ /dev/null @@ -1,29 +0,0 @@ -files->get("File"); - return new Response($action->act($file->getPathname())); - } - - } - diff --git a/src/Controller/SortPriceController.php b/src/Controller/SortPriceController.php deleted file mode 100644 index 0f1d250..0000000 --- a/src/Controller/SortPriceController.php +++ /dev/null @@ -1,24 +0,0 @@ -act($request->serialise())); - } -} diff --git a/src/Controller/UniqElementsController.php b/src/Controller/UniqElementsController.php deleted file mode 100644 index 442c9d7..0000000 --- a/src/Controller/UniqElementsController.php +++ /dev/null @@ -1,19 +0,0 @@ -act($request->serialise())); - } -} diff --git a/src/Requests/AllFri13Request.php b/src/Requests/AllFri13Request.php deleted file mode 100644 index d98cebb..0000000 --- a/src/Requests/AllFri13Request.php +++ /dev/null @@ -1,21 +0,0 @@ -year; - } -} \ No newline at end of file diff --git a/src/Requests/BaseRequest.php b/src/Requests/BaseRequest.php deleted file mode 100644 index b2fb49e..0000000 --- a/src/Requests/BaseRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -populate(); - - if (self::AUTO_VALIDATE) { - $this->validate(); - } - } - - protected function populate(): void - { - foreach ($this->getRequest()->toArray() as $property => $value) { - if (property_exists($this, $property)) { - $this->{$property} = $value; - } - } - } - - /** - * валидация и выброкса ошибки при валидации - * @return void - */ - public function validate() - { - $errors = $this->validator->validate($this); - - $messages = [ - 'message' => 'validation_failed', - 'errors' => [] - ]; - - foreach ($errors as $error) { - $messages['errors'][] = [ - 'property' => $error->getPropertyPath(), - 'value' => $error->getInvalidValue(), - 'message' => $error->getMessage(), - ]; - } - - if (count($messages['errors']) > 0) { - $response = new JsonResponse($messages, 201); - $response->send(); - - throw new ValidatorException('Validation failed', $messages); - } - } - - public function getRequest(): Request - { - return Request::createFromGlobals(); - } - - abstract public function serialise(): mixed; -} \ No newline at end of file diff --git a/src/Requests/BeforeNYDateRequest.php b/src/Requests/BeforeNYDateRequest.php deleted file mode 100644 index 445bc20..0000000 --- a/src/Requests/BeforeNYDateRequest.php +++ /dev/null @@ -1,19 +0,0 @@ -date); - } -} diff --git a/src/Requests/DiffDaysRequest.php b/src/Requests/DiffDaysRequest.php deleted file mode 100644 index 95295fd..0000000 --- a/src/Requests/DiffDaysRequest.php +++ /dev/null @@ -1,29 +0,0 @@ - new DateTimeImmutable($this->startDate), - 'endDate' => new DateTimeImmutable($this->endDate), - ]; - } -} \ No newline at end of file diff --git a/src/Requests/MenuRequest.php b/src/Requests/MenuRequest.php deleted file mode 100644 index 99bf783..0000000 --- a/src/Requests/MenuRequest.php +++ /dev/null @@ -1,32 +0,0 @@ - [ - new NotBlank(), - new Type('string'), - ], - 'depth' => [ - new NotBlank(), - new Type('integer'), - ] - ]) - )] - public $menu; - - public function serialise(): mixed - { - return $this->menu; - } -} diff --git a/src/Requests/PricesRequest.php b/src/Requests/PricesRequest.php deleted file mode 100644 index dadac42..0000000 --- a/src/Requests/PricesRequest.php +++ /dev/null @@ -1,42 +0,0 @@ - [ - new NotBlank(), - new Type('integer'), - ], - 'count' => [ - new NotBlank(), - new Type('integer'), - ], - ], - ) - ] - )] - public $prices; - - /** - * серализация реквеста под массив - * @return mixed - */ - public function serialise(): mixed - { - return $this->prices; - } -} diff --git a/src/Requests/UniqElementsRequest.php b/src/Requests/UniqElementsRequest.php deleted file mode 100644 index 1117313..0000000 --- a/src/Requests/UniqElementsRequest.php +++ /dev/null @@ -1,21 +0,0 @@ -data; - } -} diff --git a/src/Requests/UsersRequest.php b/src/Requests/UsersRequest.php deleted file mode 100644 index 1d5bd95..0000000 --- a/src/Requests/UsersRequest.php +++ /dev/null @@ -1,45 +0,0 @@ - [ - new Type('integer'), - new NotBlank(), - ], - 'name' => [ - new Type('string'), - new NotBlank(), - ], - 'age' => new Optional([ - new Type('integer'), - ]) - ]) - )] - public $users; - - /** - * @return array - */ - public function serialise(): array - { - return [ - 'id' => $this->id, - 'users' => $this->users, - ]; - } -} \ No newline at end of file diff --git a/templates/count_friday13/index.html.twig b/templates/count_friday13/index.html.twig deleted file mode 100644 index e90908d..0000000 --- a/templates/count_friday13/index.html.twig +++ /dev/null @@ -1,20 +0,0 @@ -{% extends 'base.html.twig' %} - -{% block title %}Hello CountFriday13Controller!{% endblock %} - -{% block body %} - - -
-

Hello {{ controller_name }}! ✅

- - This friendly message is coming from: -
    -
  • Your controller at /home/tamanit/myProj/iqdevTranningProgram/src/Controller/CountFriday13Controller.php
  • -
  • Your template at /home/tamanit/myProj/iqdevTranningProgram/templates/count_friday13/index.html.twig
  • -
-
-{% endblock %} diff --git a/templates/diff_days/index.html.twig b/templates/diff_days/index.html.twig deleted file mode 100644 index 462ac0b..0000000 --- a/templates/diff_days/index.html.twig +++ /dev/null @@ -1,20 +0,0 @@ -{% extends 'base.html.twig' %} - -{% block title %}Hello DiffDaysController!{% endblock %} - -{% block body %} - - -
-

Hello {{ controller_name }}! ✅

- - This friendly message is coming from: -
    -
  • Your controller at /home/tamanit/myProj/iqdevTranningProgram/src/Controller/DiffDaysController.php
  • -
  • Your template at /home/tamanit/myProj/iqdevTranningProgram/templates/diff_days/index.html.twig
  • -
-
-{% endblock %} diff --git a/templates/how_days_to_ny/index.html.twig b/templates/how_days_to_ny/index.html.twig deleted file mode 100644 index 4058510..0000000 --- a/templates/how_days_to_ny/index.html.twig +++ /dev/null @@ -1,20 +0,0 @@ -{% extends 'base.html.twig' %} - -{% block title %}Hello HowDaysToNYController!{% endblock %} - -{% block body %} - - -
-

Hello {{ controller_name }}! ✅

- - This friendly message is coming from: -
    -
  • Your controller at /home/tamanit/myProj/iqdevTranningProgram/src/Controller/HowDaysToNYController.php
  • -
  • Your template at /home/tamanit/myProj/iqdevTranningProgram/templates/how_days_to_ny/index.html.twig
  • -
-
-{% endblock %} diff --git a/templates/prepare_menu/index.html.twig b/templates/prepare_menu/index.html.twig deleted file mode 100644 index ddfd6d1..0000000 --- a/templates/prepare_menu/index.html.twig +++ /dev/null @@ -1,20 +0,0 @@ -{% extends 'base.html.twig' %} - -{% block title %}Hello PrepareMenuController!{% endblock %} - -{% block body %} - - -
-

Hello {{ controller_name }}! ✅

- - This friendly message is coming from: -
    -
  • Your controller at /home/tamanit/myProj/iqdevTranningProgram/src/Controller/PrepareMenuController.php
  • -
  • Your template at /home/tamanit/myProj/iqdevTranningProgram/templates/prepare_menu/index.html.twig
  • -
-
-{% endblock %} diff --git a/templates/read_file_line_by_line/index.html.twig b/templates/read_file_line_by_line/index.html.twig deleted file mode 100644 index 68aed51..0000000 --- a/templates/read_file_line_by_line/index.html.twig +++ /dev/null @@ -1,20 +0,0 @@ -{% extends 'base.html.twig' %} - -{% block title %}Hello ReadFileLineByLineController!{% endblock %} - -{% block body %} - - -
-

Hello {{ controller_name }}! ✅

- - This friendly message is coming from: -
    -
  • Your controller at /home/tamanit/myProj/iqdevTranningProgram/src/Controller/ReadFileLineByLineController.php
  • -
  • Your template at /home/tamanit/myProj/iqdevTranningProgram/templates/read_file_line_by_line/index.html.twig
  • -
-
-{% endblock %} diff --git a/templates/read_log_file/index.html.twig b/templates/read_log_file/index.html.twig deleted file mode 100644 index 9f08f19..0000000 --- a/templates/read_log_file/index.html.twig +++ /dev/null @@ -1,20 +0,0 @@ -{% extends 'base.html.twig' %} - -{% block title %}Hello ReadLogFileController!{% endblock %} - -{% block body %} - - -
-

Hello {{ controller_name }}! ✅

- - This friendly message is coming from: -
    -
  • Your controller at /home/tamanit/myProj/iqdevTranningProgram/src/Controller/ReadLogFileController.php
  • -
  • Your template at /home/tamanit/myProj/iqdevTranningProgram/templates/read_log_file/index.html.twig
  • -
-
-{% endblock %} diff --git a/templates/search/index.html.twig b/templates/search/index.html.twig deleted file mode 100644 index bd465aa..0000000 --- a/templates/search/index.html.twig +++ /dev/null @@ -1,20 +0,0 @@ -{% extends 'base.html.twig' %} - -{% block title %}Hello SearchController!{% endblock %} - -{% block body %} - - -
-

Hello {{ controller_name }}! ✅

- - This friendly message is coming from: -
    -
  • Your controller at /home/tamanit/myProj/iqdevTranningProgram/src/Controller/SearchController.php
  • -
  • Your template at /home/tamanit/myProj/iqdevTranningProgram/templates/search/index.html.twig
  • -
-
-{% endblock %} diff --git a/templates/sort_price/index.html.twig b/templates/sort_price/index.html.twig deleted file mode 100644 index cd62397..0000000 --- a/templates/sort_price/index.html.twig +++ /dev/null @@ -1,20 +0,0 @@ -{% extends 'base.html.twig' %} - -{% block title %}Hello SortPriceController!{% endblock %} - -{% block body %} - - -
-

Hello {{ controller_name }}! ✅

- - This friendly message is coming from: -
    -
  • Your controller at /home/tamanit/myProj/iqdevTranningProgram/src/Controller/SortPriceController.php
  • -
  • Your template at /home/tamanit/myProj/iqdevTranningProgram/templates/sort_price/index.html.twig
  • -
-
-{% endblock %} diff --git a/templates/uniq_elements/index.html.twig b/templates/uniq_elements/index.html.twig deleted file mode 100644 index d56494b..0000000 --- a/templates/uniq_elements/index.html.twig +++ /dev/null @@ -1,20 +0,0 @@ -{% extends 'base.html.twig' %} - -{% block title %}Hello UniqElementsController!{% endblock %} - -{% block body %} - - -
-

Hello {{ controller_name }}! ✅

- - This friendly message is coming from: -
    -
  • Your controller at /home/tamanit/myProj/iqdevTranningProgram/src/Controller/UniqElementsController.php
  • -
  • Your template at /home/tamanit/myProj/iqdevTranningProgram/templates/uniq_elements/index.html.twig
  • -
-
-{% endblock %} -- GitLab From 0b2b6b17e5d28130a360a5f54e630567ee5e7a44 Mon Sep 17 00:00:00 2001 From: "Alex. Plokhikh" Date: Fri, 26 Apr 2024 17:01:57 +0500 Subject: [PATCH 05/14] STA-931|update gitignore --- .gitignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index d059396..f1ebd4a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ # --- block jetbrains files --- -.idea/ +/.idea/ # ----------------------------- + +# ------ block env files ------ +/.env \ No newline at end of file -- GitLab From 0a1b860a2d1248d532b45bf9659076c713aafa8e Mon Sep 17 00:00:00 2001 From: "Alex. Plokhikh" Date: Fri, 26 Apr 2024 17:06:10 +0500 Subject: [PATCH 06/14] STA-931|update another gitignore --- app/.gitignore | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/.gitignore b/app/.gitignore index 09ca950..a1ade67 100644 --- a/app/.gitignore +++ b/app/.gitignore @@ -1,5 +1,6 @@ ###> symfony/framework-bundle ### +/.env /.env.local /.env.local.php /.env.*.local @@ -23,5 +24,3 @@ /public/assets/ /assets/vendor/ ###< symfony/asset-mapper ### - -.idea -- GitLab From 8154d66daf0c12b1894165b1f1f18902bc8bb248 Mon Sep 17 00:00:00 2001 From: "Alex. Plokhikh" Date: Fri, 26 Apr 2024 17:09:17 +0500 Subject: [PATCH 07/14] STA-931|update docker configuration --- .env.example | 0 app/.gitignore | 1 + docker-compose.yml | 46 ++++++++++++++++++++++++++++++ docker/App.Dockerfile | 15 ++++++++++ docker/App.Dockerfile.dockerignore | 0 nginx/default.conf | 25 ++++++++++++++++ 6 files changed, 87 insertions(+) create mode 100644 .env.example create mode 100644 docker-compose.yml create mode 100644 docker/App.Dockerfile create mode 100644 docker/App.Dockerfile.dockerignore create mode 100644 nginx/default.conf diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..e69de29 diff --git a/app/.gitignore b/app/.gitignore index a1ade67..50be080 100644 --- a/app/.gitignore +++ b/app/.gitignore @@ -8,6 +8,7 @@ /public/bundles/ /var/ /vendor/ +composer.lock ###< symfony/framework-bundle ### ###> phpunit/phpunit ### diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..f4f1144 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,46 @@ +version: '3.1' + +services: + db: + image: postgres:16.2 + container_name: ${APP_NAME}-db + environment: + POSTGRES_PASSWORD: ${DB_PASSWORD} + POSTGRES_USER: ${DB_USER} + POSTGRES_DB: ${DB_NAME} + networks: + - app + ports: + - '5432:5432' + + nginx: + image: nginx:stable-alpine + container_name: ${APP_NAME}-nginx + ports: + - '80:80' + volumes: + - ./app:/var/www/project + - ./nginx/default.conf:/etc/nginx/conf.d/default.conf + networks: + - app + links: + - app + depends_on: + - app + + app: + build: + context: . + dockerfile: docker/App.Dockerfile + ports: + - '9000:9000' + volumes: + - ./app:/var/www/project + networks: + - app + depends_on: + - db + +networks: + app: + driver: bridge \ No newline at end of file diff --git a/docker/App.Dockerfile b/docker/App.Dockerfile new file mode 100644 index 0000000..76b3fbc --- /dev/null +++ b/docker/App.Dockerfile @@ -0,0 +1,15 @@ +FROM php:fpm-alpine + +WORKDIR app + +COPY app . + +RUN apk update && \ + apk add libpq-dev && \ + docker-php-ext-install pdo pdo_pgsql pgsql + +ENV COMPOSER_ALLOW_SUPERUSER=1 +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +RUN composer install + +CMD ["php-fpm"] \ No newline at end of file diff --git a/docker/App.Dockerfile.dockerignore b/docker/App.Dockerfile.dockerignore new file mode 100644 index 0000000..e69de29 diff --git a/nginx/default.conf b/nginx/default.conf new file mode 100644 index 0000000..4145474 --- /dev/null +++ b/nginx/default.conf @@ -0,0 +1,25 @@ +server { + listen 80; + index index.php; + server_name localhost; + root /var/www/project/public; + location / { + try_files $uri /index.php$is_args$args; + } +location ~ ^/index\.php(/|$) { + fastcgi_pass php82-service:9000; + fastcgi_split_path_info ^(.+\.php)(/.*)$; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; + fastcgi_param DOCUMENT_ROOT $realpath_root; + fastcgi_buffer_size 128k; + fastcgi_buffers 4 256k; + fastcgi_busy_buffers_size 256k; + internal; + } +location ~ \.php$ { + return 404; + } +error_log /var/log/nginx/project_error.log; + access_log /var/log/nginx/project_access.log; +} \ No newline at end of file -- GitLab From af3d76f1c425585f38f8bf1a726b8413cbdfad58 Mon Sep 17 00:00:00 2001 From: "Alex. Plokhikh" Date: Fri, 26 Apr 2024 17:14:14 +0500 Subject: [PATCH 08/14] rm env file for app set example env file rm useless docker-compose file --- .env.example | 33 +++++++++++++++++++++++++++++++ app/.env | 41 --------------------------------------- docker/docker-compose.yml | 39 ------------------------------------- 3 files changed, 33 insertions(+), 80 deletions(-) delete mode 100644 app/.env delete mode 100644 docker/docker-compose.yml diff --git a/.env.example b/.env.example index e69de29..c6f696d 100644 --- a/.env.example +++ b/.env.example @@ -0,0 +1,33 @@ +# In all environments, the following files are loaded if they exist, +# the latter taking precedence over the former: +# +# * .env contains default values for the environment variables needed by the app +# * .env.local uncommitted file with local overrides +# * .env.$APP_ENV committed environment-specific defaults +# * .env.$APP_ENV.local uncommitted environment-specific overrides +# +# Real environment variables win over .env files. +# +# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES. +# https://symfony.com/doc/current/configuration/secrets.html +# +# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2). +# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration + +# --- name for containers --- + +# --------------------------- + +# ---- data base config ----- +#DB_URL="postgresql://db:5432/fenix?serverVersion=16&charset=utf8" + +# --------------------------- + +# - symfony/framework-bundle - +#APP_ENV=dev +#APP_SECRET=397fa37eb874a2d47f2cac19e2f8802a +# ---------------------------- + +# ---- symfony/messenger ----- +#MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0 +# ---------------------------- \ No newline at end of file diff --git a/app/.env b/app/.env deleted file mode 100644 index f00e606..0000000 --- a/app/.env +++ /dev/null @@ -1,41 +0,0 @@ -# In all environments, the following files are loaded if they exist, -# the latter taking precedence over the former: -# -# * .env contains default values for the environment variables needed by the app -# * .env.local uncommitted file with local overrides -# * .env.$APP_ENV committed environment-specific defaults -# * .env.$APP_ENV.local uncommitted environment-specific overrides -# -# Real environment variables win over .env files. -# -# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES. -# https://symfony.com/doc/current/configuration/secrets.html -# -# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2). -# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration - -###> symfony/framework-bundle ### -APP_ENV=dev -APP_SECRET=397fa37eb874a2d47f2cac19e2f8802a -###< symfony/framework-bundle ### - -###> doctrine/doctrine-bundle ### -# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url -# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml -# -# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db" -# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8.0.32&charset=utf8mb4" -# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=10.11.2-MariaDB&charset=utf8mb4" -DATABASE_URL="postgresql://app:!ChangeMe!@127.0.0.1:5432/app?serverVersion=16&charset=utf8" -###< doctrine/doctrine-bundle ### - -###> symfony/messenger ### -# Choose one of the transports below -# MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages -# MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages -MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0 -###< symfony/messenger ### - -###> symfony/mailer ### -# MAILER_DSN=null://null -###< symfony/mailer ### diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml deleted file mode 100644 index e529552..0000000 --- a/docker/docker-compose.yml +++ /dev/null @@ -1,39 +0,0 @@ -version: '3.1' - -services: - db: - image: postgres:16.2 - environment: - POSTGRES_PASSWORD: 'root' - POSTGRES_USER: 'root' - networks: - - app - ports: - - '5432:5432' - - nginx: - build: - context: ../ - dockerfile: docker/nginx/Dockerfile - ports: - - '80:80' - - '433:433' - networks: - - app - links: - - app - depends_on: - - app - - app: - build: - context: ../ - dockerfile: docker/php/Dockerfile - networks: - - app - depends_on: - - db - -networks: - app: - driver: bridge \ No newline at end of file -- GitLab From be223d144fe33486530bd5a6ee69ed9ab281b097 Mon Sep 17 00:00:00 2001 From: "Alex. Plokhikh" Date: Fri, 26 Apr 2024 17:46:35 +0500 Subject: [PATCH 09/14] STA-931|setup docker & nginx & db --- app/config/packages/doctrine.yaml | 4 +++- docker-compose.yml | 1 + docker/App.Dockerfile | 2 +- docker/App.Dockerfile.dockerignore | 5 +++++ docker/nginx/Dockerfile | 5 ----- docker/nginx/default.conf | 16 ---------------- docker/php/Dockerfile | 15 --------------- nginx/default.conf | 2 +- 8 files changed, 11 insertions(+), 39 deletions(-) delete mode 100644 docker/nginx/Dockerfile delete mode 100644 docker/nginx/default.conf delete mode 100644 docker/php/Dockerfile diff --git a/app/config/packages/doctrine.yaml b/app/config/packages/doctrine.yaml index 75ec9e8..bf5aa40 100644 --- a/app/config/packages/doctrine.yaml +++ b/app/config/packages/doctrine.yaml @@ -1,6 +1,8 @@ doctrine: dbal: - url: '%env(resolve:DATABASE_URL)%' + url: '%env(resolve:DB_URL)%' + user: '%env(resolve:DB_USER)%' + password: '%env(resolve:DB_PASSWORD)%' # IMPORTANT: You MUST configure your server version, # either here or in the DATABASE_URL env var (see .env file) diff --git a/docker-compose.yml b/docker-compose.yml index f4f1144..b0e0e0f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -32,6 +32,7 @@ services: build: context: . dockerfile: docker/App.Dockerfile + container_name: ${APP_NAME}-app ports: - '9000:9000' volumes: diff --git a/docker/App.Dockerfile b/docker/App.Dockerfile index 76b3fbc..99a70ef 100644 --- a/docker/App.Dockerfile +++ b/docker/App.Dockerfile @@ -1,6 +1,6 @@ FROM php:fpm-alpine -WORKDIR app +WORKDIR var/www/project COPY app . diff --git a/docker/App.Dockerfile.dockerignore b/docker/App.Dockerfile.dockerignore index e69de29..468f164 100644 --- a/docker/App.Dockerfile.dockerignore +++ b/docker/App.Dockerfile.dockerignore @@ -0,0 +1,5 @@ +# --- ignore autogenerated composer files --- +/app/var/ +/app/vendor/ +/app/composer.lock +# ------------------------------------------- \ No newline at end of file diff --git a/docker/nginx/Dockerfile b/docker/nginx/Dockerfile deleted file mode 100644 index a5bbf7c..0000000 --- a/docker/nginx/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM nginx:alpine - -COPY app app - -ADD docker/nginx/default.conf /etc/nginx/conf.d/ \ No newline at end of file diff --git a/docker/nginx/default.conf b/docker/nginx/default.conf deleted file mode 100644 index 3df54dd..0000000 --- a/docker/nginx/default.conf +++ /dev/null @@ -1,16 +0,0 @@ -server { - index index.php; - error_log /var/log/nginx/error.log; - access_log /var/log/nginx/access.log; - root /app/public; - - location ~ \.php$ { - try_files $uri =404; - fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_pass app:9000; - fastcgi_index index.php; - include fastcgi_params; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - fastcgi_param PATH_INFO $fastcgi_path_info; - } -} diff --git a/docker/php/Dockerfile b/docker/php/Dockerfile deleted file mode 100644 index 76b3fbc..0000000 --- a/docker/php/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM php:fpm-alpine - -WORKDIR app - -COPY app . - -RUN apk update && \ - apk add libpq-dev && \ - docker-php-ext-install pdo pdo_pgsql pgsql - -ENV COMPOSER_ALLOW_SUPERUSER=1 -RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer -RUN composer install - -CMD ["php-fpm"] \ No newline at end of file diff --git a/nginx/default.conf b/nginx/default.conf index 4145474..3a58e90 100644 --- a/nginx/default.conf +++ b/nginx/default.conf @@ -7,7 +7,7 @@ server { try_files $uri /index.php$is_args$args; } location ~ ^/index\.php(/|$) { - fastcgi_pass php82-service:9000; + fastcgi_pass app:9000; fastcgi_split_path_info ^(.+\.php)(/.*)$; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; -- GitLab From 4f8aeed5db24381b943ec23780a8980871bbe0ff Mon Sep 17 00:00:00 2001 From: "Alex. Plokhikh" Date: Fri, 26 Apr 2024 18:35:32 +0500 Subject: [PATCH 10/14] STA-931|update docker conf for do not double env file --- docker-compose.yml | 1 + docker/App.Dockerfile | 1 + 2 files changed, 2 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index b0e0e0f..3a73066 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,6 +21,7 @@ services: volumes: - ./app:/var/www/project - ./nginx/default.conf:/etc/nginx/conf.d/default.conf + - ./.env:/var/www/project/.env networks: - app links: diff --git a/docker/App.Dockerfile b/docker/App.Dockerfile index 99a70ef..ce0945b 100644 --- a/docker/App.Dockerfile +++ b/docker/App.Dockerfile @@ -3,6 +3,7 @@ FROM php:fpm-alpine WORKDIR var/www/project COPY app . +COPY .env . RUN apk update && \ apk add libpq-dev && \ -- GitLab From 00f560f4bb513573c4e2a36b034657409ad152bf Mon Sep 17 00:00:00 2001 From: "Alex. Plokhikh" Date: Sat, 27 Apr 2024 13:48:25 +0500 Subject: [PATCH 11/14] cleanup foolish entity --- app/src/Entity/Address.php | 51 -- app/src/Entity/Email.php | 51 -- app/src/Entity/Kitchens.php | 75 --- app/src/Entity/News.php | 230 --------- app/src/Entity/NewsCategories.php | 50 -- app/src/Entity/NewsComments.php | 142 ------ app/src/Entity/NewsType.php | 93 ---- app/src/Entity/Phone.php | 51 -- app/src/Entity/RestauranTypes.php | 93 ---- app/src/Entity/Restaurants.php | 461 ------------------ app/src/Entity/Settlements.php | 154 ------ app/src/Entity/Tags.php | 72 --- app/src/Entity/Users.php | 221 --------- app/src/Repository/AddressRepository.php | 48 -- app/src/Repository/EmailRepository.php | 48 -- app/src/Repository/KitchensRepository.php | 48 -- .../Repository/NewsCategoriesRepository.php | 48 -- app/src/Repository/NewsCommentsRepository.php | 48 -- app/src/Repository/NewsRepository.php | 48 -- app/src/Repository/NewsTypeRepository.php | 48 -- app/src/Repository/PhoneRepository.php | 48 -- .../Repository/RestauranTypesRepository.php | 48 -- app/src/Repository/RestaurantsRepository.php | 48 -- app/src/Repository/SettlementsRepository.php | 48 -- app/src/Repository/TagsRepository.php | 48 -- app/src/Repository/UsersRepository.php | 48 -- app/templates/news_types/index.html.twig | 20 - docker/.env | 3 - docker/docker-compose.yml | 0 29 files changed, 2391 deletions(-) delete mode 100644 app/src/Entity/Address.php delete mode 100644 app/src/Entity/Email.php delete mode 100644 app/src/Entity/Kitchens.php delete mode 100644 app/src/Entity/News.php delete mode 100644 app/src/Entity/NewsCategories.php delete mode 100644 app/src/Entity/NewsComments.php delete mode 100644 app/src/Entity/NewsType.php delete mode 100644 app/src/Entity/Phone.php delete mode 100644 app/src/Entity/RestauranTypes.php delete mode 100644 app/src/Entity/Restaurants.php delete mode 100644 app/src/Entity/Settlements.php delete mode 100644 app/src/Entity/Tags.php delete mode 100644 app/src/Entity/Users.php delete mode 100644 app/src/Repository/AddressRepository.php delete mode 100644 app/src/Repository/EmailRepository.php delete mode 100644 app/src/Repository/KitchensRepository.php delete mode 100644 app/src/Repository/NewsCategoriesRepository.php delete mode 100644 app/src/Repository/NewsCommentsRepository.php delete mode 100644 app/src/Repository/NewsRepository.php delete mode 100644 app/src/Repository/NewsTypeRepository.php delete mode 100644 app/src/Repository/PhoneRepository.php delete mode 100644 app/src/Repository/RestauranTypesRepository.php delete mode 100644 app/src/Repository/RestaurantsRepository.php delete mode 100644 app/src/Repository/SettlementsRepository.php delete mode 100644 app/src/Repository/TagsRepository.php delete mode 100644 app/src/Repository/UsersRepository.php delete mode 100644 app/templates/news_types/index.html.twig delete mode 100644 docker/.env delete mode 100644 docker/docker-compose.yml diff --git a/app/src/Entity/Address.php b/app/src/Entity/Address.php deleted file mode 100644 index f42f489..0000000 --- a/app/src/Entity/Address.php +++ /dev/null @@ -1,51 +0,0 @@ -id; - } - - public function getRestaurantId(): ?Restaurants - { - return $this->restaurant_id; - } - - public function setRestaurantId(?Restaurants $restaurant_id): static - { - $this->restaurant_id = $restaurant_id; - - return $this; - } - - public function getAddress(): ?string - { - return $this->address; - } - - public function setAddress(string $address): static - { - $this->address = $address; - - return $this; - } -} diff --git a/app/src/Entity/Email.php b/app/src/Entity/Email.php deleted file mode 100644 index 8d4b850..0000000 --- a/app/src/Entity/Email.php +++ /dev/null @@ -1,51 +0,0 @@ -id; - } - - public function getRestaurantId(): ?Restaurants - { - return $this->restaurant_id; - } - - public function setRestaurantId(?Restaurants $restaurant_id): static - { - $this->restaurant_id = $restaurant_id; - - return $this; - } - - public function getEmail(): ?string - { - return $this->email; - } - - public function setEmail(string $email): static - { - $this->email = $email; - - return $this; - } -} diff --git a/app/src/Entity/Kitchens.php b/app/src/Entity/Kitchens.php deleted file mode 100644 index 8aa783d..0000000 --- a/app/src/Entity/Kitchens.php +++ /dev/null @@ -1,75 +0,0 @@ - - */ - #[ORM\ManyToMany(targetEntity: Restaurants::class, mappedBy: 'kitchens_id')] - private Collection $restaurants_id; - - public function __construct() - { - $this->restaurants_id = new ArrayCollection(); - } - - public function getId(): ?int - { - return $this->id; - } - - public function getName(): ?string - { - return $this->name; - } - - public function setName(string $name): static - { - $this->name = $name; - - return $this; - } - - /** - * @return Collection - */ - public function getRestaurantsId(): Collection - { - return $this->restaurants_id; - } - - public function addRestaurantsId(Restaurants $restaurantsId): static - { - if (!$this->restaurants_id->contains($restaurantsId)) { - $this->restaurants_id->add($restaurantsId); - $restaurantsId->addKitchensId($this); - } - - return $this; - } - - public function removeRestaurantsId(Restaurants $restaurantsId): static - { - if ($this->restaurants_id->removeElement($restaurantsId)) { - $restaurantsId->removeKitchensId($this); - } - - return $this; - } -} diff --git a/app/src/Entity/News.php b/app/src/Entity/News.php deleted file mode 100644 index bbc53be..0000000 --- a/app/src/Entity/News.php +++ /dev/null @@ -1,230 +0,0 @@ - - */ - #[ORM\OneToMany(targetEntity: NewsComments::class, mappedBy: 'news_id')] - private Collection $news_comments_id; - - public function __construct() - { - $this->news_comments_id = new ArrayCollection(); - } - - public function getId(): ?int - { - return $this->id; - } - - public function getCode(): ?string - { - return $this->code; - } - - public function setCode(string $code): static - { - $this->code = $code; - - return $this; - } - - public function isActive(): ?bool - { - return $this->active; - } - - public function setActive(bool $active): static - { - $this->active = $active; - - return $this; - } - - public function getCreateAt(): ?\DateTimeImmutable - { - return $this->create_at; - } - - public function setCreateAt(\DateTimeImmutable $create_at): static - { - $this->create_at = $create_at; - - return $this; - } - - public function getUpdateAt(): ?\DateTimeInterface - { - return $this->update_at; - } - - public function setUpdateAt(\DateTimeInterface $update_at): static - { - $this->update_at = $update_at; - - return $this; - } - - public function getSort(): ?int - { - return $this->sort; - } - - public function setSort(int $sort): static - { - $this->sort = $sort; - - return $this; - } - - public function getPreviewImage(): ?string - { - return $this->preview_image; - } - - public function setPreviewImage(?string $preview_image): static - { - $this->preview_image = $preview_image; - - return $this; - } - - public function getDetailImage(): ?string - { - return $this->detail_image; - } - - public function setDetailImage(?string $detail_image): static - { - $this->detail_image = $detail_image; - - return $this; - } - - public function getPreviewText(): ?string - { - return $this->preview_text; - } - - public function setPreviewText(?string $preview_text): static - { - $this->preview_text = $preview_text; - - return $this; - } - - public function getDetailTest(): ?string - { - return $this->detail_test; - } - - public function setDetailTest(?string $detail_test): static - { - $this->detail_test = $detail_test; - - return $this; - } - - public function getTypeId(): ?NewsType - { - return $this->type_id; - } - - public function setTypeId(?NewsType $type_id): static - { - $this->type_id = $type_id; - - return $this; - } - - public function isMainPageRender(): ?bool - { - return $this->main_page_render; - } - - public function setMainPageRender(bool $main_page_render): static - { - $this->main_page_render = $main_page_render; - - return $this; - } - - /** - * @return Collection - */ - public function getNewsCommentsId(): Collection - { - return $this->news_comments_id; - } - - public function addNewsCommentsId(NewsComments $newsCommentsId): static - { - if (!$this->news_comments_id->contains($newsCommentsId)) { - $this->news_comments_id->add($newsCommentsId); - $newsCommentsId->setNewsId($this); - } - - return $this; - } - - public function removeNewsCommentsId(NewsComments $newsCommentsId): static - { - if ($this->news_comments_id->removeElement($newsCommentsId)) { - // set the owning side to null (unless already changed) - if ($newsCommentsId->getNewsId() === $this) { - $newsCommentsId->setNewsId(null); - } - } - - return $this; - } -} diff --git a/app/src/Entity/NewsCategories.php b/app/src/Entity/NewsCategories.php deleted file mode 100644 index 8d86aa2..0000000 --- a/app/src/Entity/NewsCategories.php +++ /dev/null @@ -1,50 +0,0 @@ -id; - } - - public function getName(): ?string - { - return $this->name; - } - - public function setName(string $name): static - { - $this->name = $name; - - return $this; - } - - public function getCode(): ?string - { - return $this->code; - } - - public function setCode(string $code): static - { - $this->code = $code; - - return $this; - } -} diff --git a/app/src/Entity/NewsComments.php b/app/src/Entity/NewsComments.php deleted file mode 100644 index 04dc1a2..0000000 --- a/app/src/Entity/NewsComments.php +++ /dev/null @@ -1,142 +0,0 @@ -id; - } - - public function getNewsId(): ?News - { - return $this->news_id; - } - - public function setNewsId(?News $news_id): static - { - $this->news_id = $news_id; - - return $this; - } - - public function isModerated(): ?bool - { - return $this->moderated; - } - - public function setModerated(?bool $moderated): static - { - $this->moderated = $moderated; - - return $this; - } - - public function getModeratorId(): ?Users - { - return $this->moderator_id; - } - - public function setModeratorId(?Users $moderator_id): static - { - $this->moderator_id = $moderator_id; - - return $this; - } - - public function getUserName(): ?string - { - return $this->user_name; - } - - public function setUserName(string $user_name): static - { - $this->user_name = $user_name; - - return $this; - } - - public function getUserId(): ?Users - { - return $this->user_id; - } - - public function setUserId(?Users $user_id): static - { - $this->user_id = $user_id; - - return $this; - } - - public function getTest(): ?string - { - return $this->test; - } - - public function setTest(string $test): static - { - $this->test = $test; - - return $this; - } - - public function getCreateAt(): ?\DateTimeImmutable - { - return $this->create_at; - } - - public function setCreateAt(\DateTimeImmutable $create_at): static - { - $this->create_at = $create_at; - - return $this; - } - - public function getUpdateAt(): ?\DateTimeInterface - { - return $this->update_at; - } - - public function setUpdateAt(\DateTimeInterface $update_at): static - { - $this->update_at = $update_at; - - return $this; - } -} diff --git a/app/src/Entity/NewsType.php b/app/src/Entity/NewsType.php deleted file mode 100644 index 2959afb..0000000 --- a/app/src/Entity/NewsType.php +++ /dev/null @@ -1,93 +0,0 @@ - - */ - #[ORM\OneToMany(targetEntity: News::class, mappedBy: 'type_id')] - private Collection $news_id; - - public function __construct() - { - $this->news_id = new ArrayCollection(); - } - - public function getId(): ?int - { - return $this->id; - } - - public function getName(): ?string - { - return $this->name; - } - - public function setName(string $name): static - { - $this->name = $name; - - return $this; - } - - public function getCode(): ?string - { - return $this->code; - } - - public function setCode(string $code): static - { - $this->code = $code; - - return $this; - } - - /** - * @return Collection - */ - public function getNewsId(): Collection - { - return $this->news_id; - } - - public function addNewsId(News $newsId): static - { - if (!$this->news_id->contains($newsId)) { - $this->news_id->add($newsId); - $newsId->setTypeId($this); - } - - return $this; - } - - public function removeNewsId(News $newsId): static - { - if ($this->news_id->removeElement($newsId)) { - // set the owning side to null (unless already changed) - if ($newsId->getTypeId() === $this) { - $newsId->setTypeId(null); - } - } - - return $this; - } -} diff --git a/app/src/Entity/Phone.php b/app/src/Entity/Phone.php deleted file mode 100644 index c808e22..0000000 --- a/app/src/Entity/Phone.php +++ /dev/null @@ -1,51 +0,0 @@ -id; - } - - public function getRestaurantId(): ?Restaurants - { - return $this->restaurant_id; - } - - public function setRestaurantId(?Restaurants $restaurant_id): static - { - $this->restaurant_id = $restaurant_id; - - return $this; - } - - public function getPhoneNumber(): ?string - { - return $this->phone_number; - } - - public function setPhoneNumber(string $phone_number): static - { - $this->phone_number = $phone_number; - - return $this; - } -} diff --git a/app/src/Entity/RestauranTypes.php b/app/src/Entity/RestauranTypes.php deleted file mode 100644 index a4bb78f..0000000 --- a/app/src/Entity/RestauranTypes.php +++ /dev/null @@ -1,93 +0,0 @@ - - */ - #[ORM\OneToMany(targetEntity: Restaurants::class, mappedBy: 'type_id')] - private Collection $restaurants_id; - - public function __construct() - { - $this->restaurants_id = new ArrayCollection(); - } - - public function getId(): ?int - { - return $this->id; - } - - public function getName(): ?string - { - return $this->name; - } - - public function setName(string $name): static - { - $this->name = $name; - - return $this; - } - - public function getCode(): ?string - { - return $this->code; - } - - public function setCode(string $code): static - { - $this->code = $code; - - return $this; - } - - /** - * @return Collection - */ - public function getRestaurantsId(): Collection - { - return $this->restaurants_id; - } - - public function addRestaurantsId(Restaurants $restaurantsId): static - { - if (!$this->restaurants_id->contains($restaurantsId)) { - $this->restaurants_id->add($restaurantsId); - $restaurantsId->setTypeId($this); - } - - return $this; - } - - public function removeRestaurantsId(Restaurants $restaurantsId): static - { - if ($this->restaurants_id->removeElement($restaurantsId)) { - // set the owning side to null (unless already changed) - if ($restaurantsId->getTypeId() === $this) { - $restaurantsId->setTypeId(null); - } - } - - return $this; - } -} diff --git a/app/src/Entity/Restaurants.php b/app/src/Entity/Restaurants.php deleted file mode 100644 index 2f26637..0000000 --- a/app/src/Entity/Restaurants.php +++ /dev/null @@ -1,461 +0,0 @@ - - */ - #[ORM\ManyToMany(targetEntity: Kitchens::class, inversedBy: 'restaurants_id')] - private Collection $kitchens_id; - - /** - * @var Collection - */ - #[ORM\OneToMany(targetEntity: Phone::class, mappedBy: 'restaurant_id')] - private Collection $phones_id; - - /** - * @var Collection - */ - #[ORM\OneToMany(targetEntity: Email::class, mappedBy: 'restaurant_id')] - private Collection $emails_id; - - /** - * @var Collection - */ - #[ORM\OneToMany(targetEntity: Address::class, mappedBy: 'restaurant_id')] - private Collection $addresses_id; - - /** - * @var Collection - */ - #[ORM\ManyToMany(targetEntity: Tags::class, mappedBy: 'restaurant_id')] - private Collection $tags_id; - - #[ORM\Column(length: 255, nullable: true)] - private ?string $site = null; - - #[ORM\Column(length: 255, nullable: true)] - private ?string $preview_image = null; - - #[ORM\Column(length: 255, nullable: true)] - private ?string $detail_image = null; - - #[ORM\Column(length: 1000, nullable: true)] - private ?string $how_to_find = null; - - public function __construct() - { - $this->kitchens_id = new ArrayCollection(); - $this->phones_id = new ArrayCollection(); - $this->emails_id = new ArrayCollection(); - $this->addresses_id = new ArrayCollection(); - $this->tags_id = new ArrayCollection(); - } - - public function getId(): ?int - { - return $this->id; - } - - public function getUuid(): ?string - { - return $this->uuid; - } - - public function setUuid(string $uuid): static - { - $this->uuid = $uuid; - - return $this; - } - - public function getName(): ?string - { - return $this->name; - } - - public function setName(string $name): static - { - $this->name = $name; - - return $this; - } - - public function getCode(): ?string - { - return $this->code; - } - - public function setCode(string $code): static - { - $this->code = $code; - - return $this; - } - - public function isActive(): ?bool - { - return $this->active; - } - - public function setActive(bool $active): static - { - $this->active = $active; - - return $this; - } - - public function getSort(): ?int - { - return $this->sort; - } - - public function setSort(int $sort): static - { - $this->sort = $sort; - - return $this; - } - - public function getCreateAt(): ?\DateTimeImmutable - { - return $this->create_at; - } - - public function setCreateAt(\DateTimeImmutable $create_at): static - { - $this->create_at = $create_at; - - return $this; - } - - public function getUpdateAt(): ?\DateTimeInterface - { - return $this->update_at; - } - - public function setUpdateAt(\DateTimeInterface $update_at): static - { - $this->update_at = $update_at; - - return $this; - } - - public function getCoordinates(): array - { - return $this->coordinates; - } - - public function setCoordinates(array $coordinates): static - { - $this->coordinates = $coordinates; - - return $this; - } - - public function getTypeId(): ?RestauranTypes - { - return $this->type_id; - } - - public function setTypeId(?RestauranTypes $type_id): static - { - $this->type_id = $type_id; - - return $this; - } - - public function getSettlementId(): ?Settlements - { - return $this->settlement_id; - } - - public function setSettlementId(?Settlements $settlement_id): static - { - $this->settlement_id = $settlement_id; - - return $this; - } - - public function getDescription(): ?string - { - return $this->description; - } - - public function setDescription(?string $description): static - { - $this->description = $description; - - return $this; - } - - public function getRecipe(): ?string - { - return $this->recipe; - } - - public function setRecipe(?string $recipe): static - { - $this->recipe = $recipe; - - return $this; - } - - public function getRecipeInfo(): ?string - { - return $this->recipe_info; - } - - public function setRecipeInfo(string $recipe_info): static - { - $this->recipe_info = $recipe_info; - - return $this; - } - - /** - * @return Collection - */ - public function getKitchensId(): Collection - { - return $this->kitchens_id; - } - - public function addKitchensId(Kitchens $kitchensId): static - { - if (!$this->kitchens_id->contains($kitchensId)) { - $this->kitchens_id->add($kitchensId); - } - - return $this; - } - - public function removeKitchensId(Kitchens $kitchensId): static - { - $this->kitchens_id->removeElement($kitchensId); - - return $this; - } - - /** - * @return Collection - */ - public function getPhonesId(): Collection - { - return $this->phones_id; - } - - public function addPhonesId(Phone $phonesId): static - { - if (!$this->phones_id->contains($phonesId)) { - $this->phones_id->add($phonesId); - $phonesId->setRestaurantId($this); - } - - return $this; - } - - public function removePhonesId(Phone $phonesId): static - { - if ($this->phones_id->removeElement($phonesId)) { - // set the owning side to null (unless already changed) - if ($phonesId->getRestaurantId() === $this) { - $phonesId->setRestaurantId(null); - } - } - - return $this; - } - - /** - * @return Collection - */ - public function getEmailsId(): Collection - { - return $this->emails_id; - } - - public function addEmailsId(Email $emailsId): static - { - if (!$this->emails_id->contains($emailsId)) { - $this->emails_id->add($emailsId); - $emailsId->setRestaurantId($this); - } - - return $this; - } - - public function removeEmailsId(Email $emailsId): static - { - if ($this->emails_id->removeElement($emailsId)) { - // set the owning side to null (unless already changed) - if ($emailsId->getRestaurantId() === $this) { - $emailsId->setRestaurantId(null); - } - } - - return $this; - } - - /** - * @return Collection - */ - public function getAddressesId(): Collection - { - return $this->addresses_id; - } - - public function addAddressesId(Address $addressesId): static - { - if (!$this->addresses_id->contains($addressesId)) { - $this->addresses_id->add($addressesId); - $addressesId->setRestaurantId($this); - } - - return $this; - } - - public function removeAddressesId(Address $addressesId): static - { - if ($this->addresses_id->removeElement($addressesId)) { - // set the owning side to null (unless already changed) - if ($addressesId->getRestaurantId() === $this) { - $addressesId->setRestaurantId(null); - } - } - - return $this; - } - - /** - * @return Collection - */ - public function getTagsId(): Collection - { - return $this->tags_id; - } - - public function addTagsId(Tags $tagsId): static - { - if (!$this->tags_id->contains($tagsId)) { - $this->tags_id->add($tagsId); - $tagsId->addRestaurantId($this); - } - - return $this; - } - - public function removeTagsId(Tags $tagsId): static - { - if ($this->tags_id->removeElement($tagsId)) { - $tagsId->removeRestaurantId($this); - } - - return $this; - } - - public function getSite(): ?string - { - return $this->site; - } - - public function setSite(?string $site): static - { - $this->site = $site; - - return $this; - } - - public function getPreviewImage(): ?string - { - return $this->preview_image; - } - - public function setPreviewImage(?string $preview_image): static - { - $this->preview_image = $preview_image; - - return $this; - } - - public function getDetailImage(): ?string - { - return $this->detail_image; - } - - public function setDetailImage(string $detail_image): static - { - $this->detail_image = $detail_image; - - return $this; - } - - public function getHowToFind(): ?string - { - return $this->how_to_find; - } - - public function setHowToFind(?string $how_to_find): static - { - $this->how_to_find = $how_to_find; - - return $this; - } -} - diff --git a/app/src/Entity/Settlements.php b/app/src/Entity/Settlements.php deleted file mode 100644 index 2f32614..0000000 --- a/app/src/Entity/Settlements.php +++ /dev/null @@ -1,154 +0,0 @@ - - */ - #[ORM\OneToMany(targetEntity: Restaurants::class, mappedBy: 'settlement_id')] - private Collection $restaurant_id; - - public function __construct() - { - $this->restaurant_id = new ArrayCollection(); - } - - public function getId(): ?int - { - return $this->id; - } - - public function getUuid(): ?string - { - return $this->uuid; - } - - public function setUuid(string $uuid): static - { - $this->uuid = $uuid; - - return $this; - } - - public function getName(): ?string - { - return $this->name; - } - - public function setName(string $name): static - { - $this->name = $name; - - return $this; - } - - public function getCode(): ?string - { - return $this->code; - } - - public function setCode(string $code): static - { - $this->code = $code; - - return $this; - } - - public function getCoordinates(): array - { - return $this->coordinates; - } - - public function setCoordinates(array $coordinates): static - { - $this->coordinates = $coordinates; - - return $this; - } - - public function getCreateAt(): ?\DateTimeImmutable - { - return $this->create_at; - } - - public function setCreateAt(\DateTimeImmutable $create_at): static - { - $this->create_at = $create_at; - - return $this; - } - - public function getUpdateAt(): ?\DateTimeInterface - { - return $this->update_at; - } - - public function setUpdateAt(\DateTimeInterface $update_at): static - { - $this->update_at = $update_at; - - return $this; - } - - /** - * @return Collection - */ - public function getRestaurantId(): Collection - { - return $this->restaurant_id; - } - - public function addRestaurantId(Restaurants $restaurantId): static - { - if (!$this->restaurant_id->contains($restaurantId)) { - $this->restaurant_id->add($restaurantId); - $restaurantId->setSettlementId($this); - } - - return $this; - } - - public function removeRestaurantId(Restaurants $restaurantId): static - { - if ($this->restaurant_id->removeElement($restaurantId)) { - // set the owning side to null (unless already changed) - if ($restaurantId->getSettlementId() === $this) { - $restaurantId->setSettlementId(null); - } - } - - return $this; - } -} diff --git a/app/src/Entity/Tags.php b/app/src/Entity/Tags.php deleted file mode 100644 index ceb5f6a..0000000 --- a/app/src/Entity/Tags.php +++ /dev/null @@ -1,72 +0,0 @@ - - */ - #[ORM\ManyToMany(targetEntity: Restaurants::class, inversedBy: 'tags_id')] - private Collection $restaurant_id; - - #[ORM\Column(length: 255)] - private ?string $name = null; - - public function __construct() - { - $this->restaurant_id = new ArrayCollection(); - } - - public function getId(): ?int - { - return $this->id; - } - - /** - * @return Collection - */ - public function getRestaurantId(): Collection - { - return $this->restaurant_id; - } - - public function addRestaurantId(Restaurants $restaurantId): static - { - if (!$this->restaurant_id->contains($restaurantId)) { - $this->restaurant_id->add($restaurantId); - } - - return $this; - } - - public function removeRestaurantId(Restaurants $restaurantId): static - { - $this->restaurant_id->removeElement($restaurantId); - - return $this; - } - - public function getName(): ?string - { - return $this->name; - } - - public function setName(string $name): static - { - $this->name = $name; - - return $this; - } -} diff --git a/app/src/Entity/Users.php b/app/src/Entity/Users.php deleted file mode 100644 index e76741d..0000000 --- a/app/src/Entity/Users.php +++ /dev/null @@ -1,221 +0,0 @@ - - */ - #[ORM\OneToMany(targetEntity: NewsComments::class, mappedBy: 'moderator_id')] - private Collection $news_comments_id_moderate; - - /** - * @var Collection - */ - #[ORM\OneToMany(targetEntity: NewsComments::class, mappedBy: 'user_id')] - private Collection $news_comments_id_comment; - - public function __construct() - { - $this->news_comments_id_moderate = new ArrayCollection(); - $this->news_comments_id_comment = new ArrayCollection(); - } - - public function getId(): ?int - { - return $this->id; - } - - public function getUuid(): ?string - { - return $this->uuid; - } - - public function setUuid(string $uuid): static - { - $this->uuid = $uuid; - - return $this; - } - - public function getName(): ?string - { - return $this->name; - } - - public function setName(string $name): static - { - $this->name = $name; - - return $this; - } - - public function isMale(): ?bool - { - return $this->isMale; - } - - public function setMale(bool $isMale): static - { - $this->isMale = $isMale; - - return $this; - } - - public function getBirthDay(): ?\DateTimeImmutable - { - return $this->birthDay; - } - - public function setBirthDay(?\DateTimeImmutable $birthDay): static - { - $this->birthDay = $birthDay; - - return $this; - } - - public function get�ф�address(): ?string - { - return $this->�ф�address; - } - - public function set�ф�address(string $�ф�address): static - { - $this->�ф�address = $�ф�address; - - return $this; - } - - public function getSurname(): ?string - { - return $this->surname; - } - - public function setSurname(string $surname): static - { - $this->surname = $surname; - - return $this; - } - - public function getPhoneNumber(): ?string - { - return $this->phone_number; - } - - public function setPhoneNumber(?string $phone_number): static - { - $this->phone_number = $phone_number; - - return $this; - } - - public function getEmail(): ?string - { - return $this->email; - } - - public function setEmail(?string $email): static - { - $this->email = $email; - - return $this; - } - - /** - * @return Collection - */ - public function getNewsCommentsIdModerate(): Collection - { - return $this->news_comments_id_moderate; - } - - public function addNewsCommentsIdModerate(NewsComments $newsCommentsIdModerate): static - { - if (!$this->news_comments_id_moderate->contains($newsCommentsIdModerate)) { - $this->news_comments_id_moderate->add($newsCommentsIdModerate); - $newsCommentsIdModerate->setModeratorId($this); - } - - return $this; - } - - public function removeNewsCommentsIdModerate(NewsComments $newsCommentsIdModerate): static - { - if ($this->news_comments_id_moderate->removeElement($newsCommentsIdModerate)) { - // set the owning side to null (unless already changed) - if ($newsCommentsIdModerate->getModeratorId() === $this) { - $newsCommentsIdModerate->setModeratorId(null); - } - } - - return $this; - } - - /** - * @return Collection - */ - public function getNewsCommentsIdComment(): Collection - { - return $this->news_comments_id_comment; - } - - public function addNewsCommentsIdComment(NewsComments $newsCommentsIdComment): static - { - if (!$this->news_comments_id_comment->contains($newsCommentsIdComment)) { - $this->news_comments_id_comment->add($newsCommentsIdComment); - $newsCommentsIdComment->setUserId($this); - } - - return $this; - } - - public function removeNewsCommentsIdComment(NewsComments $newsCommentsIdComment): static - { - if ($this->news_comments_id_comment->removeElement($newsCommentsIdComment)) { - // set the owning side to null (unless already changed) - if ($newsCommentsIdComment->getUserId() === $this) { - $newsCommentsIdComment->setUserId(null); - } - } - - return $this; - } -} diff --git a/app/src/Repository/AddressRepository.php b/app/src/Repository/AddressRepository.php deleted file mode 100644 index e87117f..0000000 --- a/app/src/Repository/AddressRepository.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * @method Address|null find($id, $lockMode = null, $lockVersion = null) - * @method Address|null findOneBy(array $criteria, array $orderBy = null) - * @method Address[] findAll() - * @method Address[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) - */ -class AddressRepository extends ServiceEntityRepository -{ - public function __construct(ManagerRegistry $registry) - { - parent::__construct($registry, Address::class); - } - -// /** -// * @return Address[] Returns an array of Address objects -// */ -// public function findByExampleField($value): array -// { -// return $this->createQueryBuilder('a') -// ->andWhere('a.exampleField = :val') -// ->setParameter('val', $value) -// ->orderBy('a.id', 'ASC') -// ->setMaxResults(10) -// ->getQuery() -// ->getResult() -// ; -// } - -// public function findOneBySomeField($value): ?Address -// { -// return $this->createQueryBuilder('a') -// ->andWhere('a.exampleField = :val') -// ->setParameter('val', $value) -// ->getQuery() -// ->getOneOrNullResult() -// ; -// } -} diff --git a/app/src/Repository/EmailRepository.php b/app/src/Repository/EmailRepository.php deleted file mode 100644 index f22b0ee..0000000 --- a/app/src/Repository/EmailRepository.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * @method Email|null find($id, $lockMode = null, $lockVersion = null) - * @method Email|null findOneBy(array $criteria, array $orderBy = null) - * @method Email[] findAll() - * @method Email[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) - */ -class EmailRepository extends ServiceEntityRepository -{ - public function __construct(ManagerRegistry $registry) - { - parent::__construct($registry, Email::class); - } - -// /** -// * @return Email[] Returns an array of Email objects -// */ -// public function findByExampleField($value): array -// { -// return $this->createQueryBuilder('e') -// ->andWhere('e.exampleField = :val') -// ->setParameter('val', $value) -// ->orderBy('e.id', 'ASC') -// ->setMaxResults(10) -// ->getQuery() -// ->getResult() -// ; -// } - -// public function findOneBySomeField($value): ?Email -// { -// return $this->createQueryBuilder('e') -// ->andWhere('e.exampleField = :val') -// ->setParameter('val', $value) -// ->getQuery() -// ->getOneOrNullResult() -// ; -// } -} diff --git a/app/src/Repository/KitchensRepository.php b/app/src/Repository/KitchensRepository.php deleted file mode 100644 index 47ef7fa..0000000 --- a/app/src/Repository/KitchensRepository.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * @method Kitchens|null find($id, $lockMode = null, $lockVersion = null) - * @method Kitchens|null findOneBy(array $criteria, array $orderBy = null) - * @method Kitchens[] findAll() - * @method Kitchens[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) - */ -class KitchensRepository extends ServiceEntityRepository -{ - public function __construct(ManagerRegistry $registry) - { - parent::__construct($registry, Kitchens::class); - } - -// /** -// * @return Kitchens[] Returns an array of Kitchens objects -// */ -// public function findByExampleField($value): array -// { -// return $this->createQueryBuilder('k') -// ->andWhere('k.exampleField = :val') -// ->setParameter('val', $value) -// ->orderBy('k.id', 'ASC') -// ->setMaxResults(10) -// ->getQuery() -// ->getResult() -// ; -// } - -// public function findOneBySomeField($value): ?Kitchens -// { -// return $this->createQueryBuilder('k') -// ->andWhere('k.exampleField = :val') -// ->setParameter('val', $value) -// ->getQuery() -// ->getOneOrNullResult() -// ; -// } -} diff --git a/app/src/Repository/NewsCategoriesRepository.php b/app/src/Repository/NewsCategoriesRepository.php deleted file mode 100644 index 46c102e..0000000 --- a/app/src/Repository/NewsCategoriesRepository.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * @method NewsCategories|null find($id, $lockMode = null, $lockVersion = null) - * @method NewsCategories|null findOneBy(array $criteria, array $orderBy = null) - * @method NewsCategories[] findAll() - * @method NewsCategories[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) - */ -class NewsCategoriesRepository extends ServiceEntityRepository -{ - public function __construct(ManagerRegistry $registry) - { - parent::__construct($registry, NewsCategories::class); - } - -// /** -// * @return NewsCategories[] Returns an array of NewsCategories objects -// */ -// public function findByExampleField($value): array -// { -// return $this->createQueryBuilder('n') -// ->andWhere('n.exampleField = :val') -// ->setParameter('val', $value) -// ->orderBy('n.id', 'ASC') -// ->setMaxResults(10) -// ->getQuery() -// ->getResult() -// ; -// } - -// public function findOneBySomeField($value): ?NewsCategories -// { -// return $this->createQueryBuilder('n') -// ->andWhere('n.exampleField = :val') -// ->setParameter('val', $value) -// ->getQuery() -// ->getOneOrNullResult() -// ; -// } -} diff --git a/app/src/Repository/NewsCommentsRepository.php b/app/src/Repository/NewsCommentsRepository.php deleted file mode 100644 index 9bf4cd0..0000000 --- a/app/src/Repository/NewsCommentsRepository.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * @method NewsComments|null find($id, $lockMode = null, $lockVersion = null) - * @method NewsComments|null findOneBy(array $criteria, array $orderBy = null) - * @method NewsComments[] findAll() - * @method NewsComments[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) - */ -class NewsCommentsRepository extends ServiceEntityRepository -{ - public function __construct(ManagerRegistry $registry) - { - parent::__construct($registry, NewsComments::class); - } - -// /** -// * @return NewsComments[] Returns an array of NewsComments objects -// */ -// public function findByExampleField($value): array -// { -// return $this->createQueryBuilder('n') -// ->andWhere('n.exampleField = :val') -// ->setParameter('val', $value) -// ->orderBy('n.id', 'ASC') -// ->setMaxResults(10) -// ->getQuery() -// ->getResult() -// ; -// } - -// public function findOneBySomeField($value): ?NewsComments -// { -// return $this->createQueryBuilder('n') -// ->andWhere('n.exampleField = :val') -// ->setParameter('val', $value) -// ->getQuery() -// ->getOneOrNullResult() -// ; -// } -} diff --git a/app/src/Repository/NewsRepository.php b/app/src/Repository/NewsRepository.php deleted file mode 100644 index 3b5d864..0000000 --- a/app/src/Repository/NewsRepository.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * @method News|null find($id, $lockMode = null, $lockVersion = null) - * @method News|null findOneBy(array $criteria, array $orderBy = null) - * @method News[] findAll() - * @method News[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) - */ -class NewsRepository extends ServiceEntityRepository -{ - public function __construct(ManagerRegistry $registry) - { - parent::__construct($registry, News::class); - } - -// /** -// * @return News[] Returns an array of News objects -// */ -// public function findByExampleField($value): array -// { -// return $this->createQueryBuilder('n') -// ->andWhere('n.exampleField = :val') -// ->setParameter('val', $value) -// ->orderBy('n.id', 'ASC') -// ->setMaxResults(10) -// ->getQuery() -// ->getResult() -// ; -// } - -// public function findOneBySomeField($value): ?News -// { -// return $this->createQueryBuilder('n') -// ->andWhere('n.exampleField = :val') -// ->setParameter('val', $value) -// ->getQuery() -// ->getOneOrNullResult() -// ; -// } -} diff --git a/app/src/Repository/NewsTypeRepository.php b/app/src/Repository/NewsTypeRepository.php deleted file mode 100644 index 385998b..0000000 --- a/app/src/Repository/NewsTypeRepository.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * @method NewsType|null find($id, $lockMode = null, $lockVersion = null) - * @method NewsType|null findOneBy(array $criteria, array $orderBy = null) - * @method NewsType[] findAll() - * @method NewsType[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) - */ -class NewsTypeRepository extends ServiceEntityRepository -{ - public function __construct(ManagerRegistry $registry) - { - parent::__construct($registry, NewsType::class); - } - -// /** -// * @return NewsType[] Returns an array of NewsType objects -// */ -// public function findByExampleField($value): array -// { -// return $this->createQueryBuilder('n') -// ->andWhere('n.exampleField = :val') -// ->setParameter('val', $value) -// ->orderBy('n.id', 'ASC') -// ->setMaxResults(10) -// ->getQuery() -// ->getResult() -// ; -// } - -// public function findOneBySomeField($value): ?NewsType -// { -// return $this->createQueryBuilder('n') -// ->andWhere('n.exampleField = :val') -// ->setParameter('val', $value) -// ->getQuery() -// ->getOneOrNullResult() -// ; -// } -} diff --git a/app/src/Repository/PhoneRepository.php b/app/src/Repository/PhoneRepository.php deleted file mode 100644 index de389d6..0000000 --- a/app/src/Repository/PhoneRepository.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * @method Phone|null find($id, $lockMode = null, $lockVersion = null) - * @method Phone|null findOneBy(array $criteria, array $orderBy = null) - * @method Phone[] findAll() - * @method Phone[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) - */ -class PhoneRepository extends ServiceEntityRepository -{ - public function __construct(ManagerRegistry $registry) - { - parent::__construct($registry, Phone::class); - } - -// /** -// * @return Phone[] Returns an array of Phone objects -// */ -// public function findByExampleField($value): array -// { -// return $this->createQueryBuilder('p') -// ->andWhere('p.exampleField = :val') -// ->setParameter('val', $value) -// ->orderBy('p.id', 'ASC') -// ->setMaxResults(10) -// ->getQuery() -// ->getResult() -// ; -// } - -// public function findOneBySomeField($value): ?Phone -// { -// return $this->createQueryBuilder('p') -// ->andWhere('p.exampleField = :val') -// ->setParameter('val', $value) -// ->getQuery() -// ->getOneOrNullResult() -// ; -// } -} diff --git a/app/src/Repository/RestauranTypesRepository.php b/app/src/Repository/RestauranTypesRepository.php deleted file mode 100644 index fd67ecb..0000000 --- a/app/src/Repository/RestauranTypesRepository.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * @method RestauranTypes|null find($id, $lockMode = null, $lockVersion = null) - * @method RestauranTypes|null findOneBy(array $criteria, array $orderBy = null) - * @method RestauranTypes[] findAll() - * @method RestauranTypes[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) - */ -class RestauranTypesRepository extends ServiceEntityRepository -{ - public function __construct(ManagerRegistry $registry) - { - parent::__construct($registry, RestauranTypes::class); - } - -// /** -// * @return RestauranTypes[] Returns an array of RestauranTypes objects -// */ -// public function findByExampleField($value): array -// { -// return $this->createQueryBuilder('r') -// ->andWhere('r.exampleField = :val') -// ->setParameter('val', $value) -// ->orderBy('r.id', 'ASC') -// ->setMaxResults(10) -// ->getQuery() -// ->getResult() -// ; -// } - -// public function findOneBySomeField($value): ?RestauranTypes -// { -// return $this->createQueryBuilder('r') -// ->andWhere('r.exampleField = :val') -// ->setParameter('val', $value) -// ->getQuery() -// ->getOneOrNullResult() -// ; -// } -} diff --git a/app/src/Repository/RestaurantsRepository.php b/app/src/Repository/RestaurantsRepository.php deleted file mode 100644 index f540695..0000000 --- a/app/src/Repository/RestaurantsRepository.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * @method Restaurants|null find($id, $lockMode = null, $lockVersion = null) - * @method Restaurants|null findOneBy(array $criteria, array $orderBy = null) - * @method Restaurants[] findAll() - * @method Restaurants[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) - */ -class RestaurantsRepository extends ServiceEntityRepository -{ - public function __construct(ManagerRegistry $registry) - { - parent::__construct($registry, Restaurants::class); - } - -// /** -// * @return Restaurants[] Returns an array of Restaurants objects -// */ -// public function findByExampleField($value): array -// { -// return $this->createQueryBuilder('r') -// ->andWhere('r.exampleField = :val') -// ->setParameter('val', $value) -// ->orderBy('r.id', 'ASC') -// ->setMaxResults(10) -// ->getQuery() -// ->getResult() -// ; -// } - -// public function findOneBySomeField($value): ?Restaurants -// { -// return $this->createQueryBuilder('r') -// ->andWhere('r.exampleField = :val') -// ->setParameter('val', $value) -// ->getQuery() -// ->getOneOrNullResult() -// ; -// } -} diff --git a/app/src/Repository/SettlementsRepository.php b/app/src/Repository/SettlementsRepository.php deleted file mode 100644 index ff6673b..0000000 --- a/app/src/Repository/SettlementsRepository.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * @method Settlements|null find($id, $lockMode = null, $lockVersion = null) - * @method Settlements|null findOneBy(array $criteria, array $orderBy = null) - * @method Settlements[] findAll() - * @method Settlements[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) - */ -class SettlementsRepository extends ServiceEntityRepository -{ - public function __construct(ManagerRegistry $registry) - { - parent::__construct($registry, Settlements::class); - } - -// /** -// * @return Settlements[] Returns an array of Settlements objects -// */ -// public function findByExampleField($value): array -// { -// return $this->createQueryBuilder('s') -// ->andWhere('s.exampleField = :val') -// ->setParameter('val', $value) -// ->orderBy('s.id', 'ASC') -// ->setMaxResults(10) -// ->getQuery() -// ->getResult() -// ; -// } - -// public function findOneBySomeField($value): ?Settlements -// { -// return $this->createQueryBuilder('s') -// ->andWhere('s.exampleField = :val') -// ->setParameter('val', $value) -// ->getQuery() -// ->getOneOrNullResult() -// ; -// } -} diff --git a/app/src/Repository/TagsRepository.php b/app/src/Repository/TagsRepository.php deleted file mode 100644 index 4f01463..0000000 --- a/app/src/Repository/TagsRepository.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * @method Tags|null find($id, $lockMode = null, $lockVersion = null) - * @method Tags|null findOneBy(array $criteria, array $orderBy = null) - * @method Tags[] findAll() - * @method Tags[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) - */ -class TagsRepository extends ServiceEntityRepository -{ - public function __construct(ManagerRegistry $registry) - { - parent::__construct($registry, Tags::class); - } - -// /** -// * @return Tags[] Returns an array of Tags objects -// */ -// public function findByExampleField($value): array -// { -// return $this->createQueryBuilder('t') -// ->andWhere('t.exampleField = :val') -// ->setParameter('val', $value) -// ->orderBy('t.id', 'ASC') -// ->setMaxResults(10) -// ->getQuery() -// ->getResult() -// ; -// } - -// public function findOneBySomeField($value): ?Tags -// { -// return $this->createQueryBuilder('t') -// ->andWhere('t.exampleField = :val') -// ->setParameter('val', $value) -// ->getQuery() -// ->getOneOrNullResult() -// ; -// } -} diff --git a/app/src/Repository/UsersRepository.php b/app/src/Repository/UsersRepository.php deleted file mode 100644 index c794b38..0000000 --- a/app/src/Repository/UsersRepository.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * @method Users|null find($id, $lockMode = null, $lockVersion = null) - * @method Users|null findOneBy(array $criteria, array $orderBy = null) - * @method Users[] findAll() - * @method Users[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) - */ -class UsersRepository extends ServiceEntityRepository -{ - public function __construct(ManagerRegistry $registry) - { - parent::__construct($registry, Users::class); - } - -// /** -// * @return Users[] Returns an array of Users objects -// */ -// public function findByExampleField($value): array -// { -// return $this->createQueryBuilder('u') -// ->andWhere('u.exampleField = :val') -// ->setParameter('val', $value) -// ->orderBy('u.id', 'ASC') -// ->setMaxResults(10) -// ->getQuery() -// ->getResult() -// ; -// } - -// public function findOneBySomeField($value): ?Users -// { -// return $this->createQueryBuilder('u') -// ->andWhere('u.exampleField = :val') -// ->setParameter('val', $value) -// ->getQuery() -// ->getOneOrNullResult() -// ; -// } -} diff --git a/app/templates/news_types/index.html.twig b/app/templates/news_types/index.html.twig deleted file mode 100644 index 310cc3a..0000000 --- a/app/templates/news_types/index.html.twig +++ /dev/null @@ -1,20 +0,0 @@ -{% extends 'base.html.twig' %} - -{% block title %}Hello NewsTypesController!{% endblock %} - -{% block body %} - - -
-

Hello {{ controller_name }}! ✅

- - This friendly message is coming from: -
    -
  • Your controller at /home/tamanit/myProj/iqdevTranningProgram/app/src/Controller/NewsTypesController.php
  • -
  • Your template at /home/tamanit/myProj/iqdevTranningProgram/app/templates/news_types/index.html.twig
  • -
-
-{% endblock %} diff --git a/docker/.env b/docker/.env deleted file mode 100644 index 7169a48..0000000 --- a/docker/.env +++ /dev/null @@ -1,3 +0,0 @@ -DATABASE_PASSWORD="root" -DATABASE_USER="root" -DATABASE_NAME="postgres" \ No newline at end of file diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml deleted file mode 100644 index e69de29..0000000 -- GitLab From da2e8419cfc463081dbbf48535ba0669501df9cd Mon Sep 17 00:00:00 2001 From: "Alex. Plokhikh" Date: Sat, 27 Apr 2024 15:25:50 +0500 Subject: [PATCH 12/14] STA-931|fix some issues --- docker/{App.Dockerfile => app/Dockerfile} | 2 +- .../Dockerfile.dockerignore} | 0 {nginx => docker/nginx}/default.conf | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename docker/{App.Dockerfile => app/Dockerfile} (92%) rename docker/{App.Dockerfile.dockerignore => app/Dockerfile.dockerignore} (100%) rename {nginx => docker/nginx}/default.conf (100%) diff --git a/docker/App.Dockerfile b/docker/app/Dockerfile similarity index 92% rename from docker/App.Dockerfile rename to docker/app/Dockerfile index ce0945b..7bde794 100644 --- a/docker/App.Dockerfile +++ b/docker/app/Dockerfile @@ -1,6 +1,6 @@ FROM php:fpm-alpine -WORKDIR var/www/project +WORKDIR /app COPY app . COPY .env . diff --git a/docker/App.Dockerfile.dockerignore b/docker/app/Dockerfile.dockerignore similarity index 100% rename from docker/App.Dockerfile.dockerignore rename to docker/app/Dockerfile.dockerignore diff --git a/nginx/default.conf b/docker/nginx/default.conf similarity index 100% rename from nginx/default.conf rename to docker/nginx/default.conf -- GitLab From 3869a46095f71f4552c725231b683d8601ecb8f8 Mon Sep 17 00:00:00 2001 From: "Alex. Plokhikh" Date: Sat, 27 Apr 2024 15:37:24 +0500 Subject: [PATCH 13/14] STA-931| fix another issues --- .env.example | 5 +++++ app/composer.json | 2 +- docker-compose.yml | 18 ++++++++---------- docker/app/Dockerfile | 2 +- docker/nginx/default.conf | 2 +- 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/.env.example b/.env.example index c6f696d..83ec4f5 100644 --- a/.env.example +++ b/.env.example @@ -30,4 +30,9 @@ # ---- symfony/messenger ----- #MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0 +# ---------------------------- + +# --------- outports --------- +#NGINX_PORT="80" +#DB_PORT="5432" # ---------------------------- \ No newline at end of file diff --git a/app/composer.json b/app/composer.json index 79c0450..564d77e 100644 --- a/app/composer.json +++ b/app/composer.json @@ -19,7 +19,7 @@ "symfony/doctrine-messenger": "6.4.*", "symfony/dotenv": "6.4.*", "symfony/expression-language": "6.4.*", - "symfony/flex": "^2", + "symfony/flex": "^2.4", "symfony/form": "6.4.*", "symfony/framework-bundle": "6.4.*", "symfony/http-client": "6.4.*", diff --git a/docker-compose.yml b/docker-compose.yml index 3a73066..d1307d3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,17 +11,16 @@ services: networks: - app ports: - - '5432:5432' + - '${DB_PORT}:5432' nginx: - image: nginx:stable-alpine + image: nginx:1.25.5-alpine container_name: ${APP_NAME}-nginx ports: - - '80:80' + - '${NGINX_PORT}:80' volumes: - - ./app:/var/www/project - - ./nginx/default.conf:/etc/nginx/conf.d/default.conf - - ./.env:/var/www/project/.env + - ./app/public:/app/public + - ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf networks: - app links: @@ -32,12 +31,11 @@ services: app: build: context: . - dockerfile: docker/App.Dockerfile + dockerfile: docker/app/Dockerfile container_name: ${APP_NAME}-app - ports: - - '9000:9000' volumes: - - ./app:/var/www/project + - ./app:/app + - ./.env:/app/.env networks: - app depends_on: diff --git a/docker/app/Dockerfile b/docker/app/Dockerfile index 7bde794..3dc122d 100644 --- a/docker/app/Dockerfile +++ b/docker/app/Dockerfile @@ -1,4 +1,4 @@ -FROM php:fpm-alpine +FROM php:8.3-fpm-alpine WORKDIR /app diff --git a/docker/nginx/default.conf b/docker/nginx/default.conf index 3a58e90..8b660bf 100644 --- a/docker/nginx/default.conf +++ b/docker/nginx/default.conf @@ -2,7 +2,7 @@ server { listen 80; index index.php; server_name localhost; - root /var/www/project/public; + root /app/public; location / { try_files $uri /index.php$is_args$args; } -- GitLab From 54e2d859dd0b38ab91680fdf377f1783acac2885 Mon Sep 17 00:00:00 2001 From: "Alex. Plokhikh" Date: Sat, 27 Apr 2024 16:47:41 +0500 Subject: [PATCH 14/14] make db struct --- app/migrations/Version20240419135600.php | 148 ------- app/migrations/Version20240427114630.php | 96 +++++ app/src/Entity/Kitchens.php | 97 +++++ app/src/Entity/News.php | 246 ++++++++++++ app/src/Entity/NewsCategories.php | 97 +++++ app/src/Entity/NewsType.php | 100 +++++ app/src/Entity/RestaurantTypes.php | 101 +++++ app/src/Entity/Restaurants.php | 379 ++++++++++++++++++ app/src/Entity/Settlements.php | 160 ++++++++ app/src/Entity/Users.php | 117 ++++++ app/src/Repository/KitchensRepository.php | 48 +++ .../Repository/NewsCategoriesRepository.php | 48 +++ app/src/Repository/NewsRepository.php | 48 +++ app/src/Repository/NewsTypeRepository.php | 48 +++ .../Repository/RestaurantTypesRepository.php | 48 +++ app/src/Repository/RestaurantsRepository.php | 48 +++ app/src/Repository/SettlementsRepository.php | 48 +++ app/src/Repository/UsersRepository.php | 48 +++ 18 files changed, 1777 insertions(+), 148 deletions(-) delete mode 100644 app/migrations/Version20240419135600.php create mode 100644 app/migrations/Version20240427114630.php create mode 100644 app/src/Entity/Kitchens.php create mode 100644 app/src/Entity/News.php create mode 100644 app/src/Entity/NewsCategories.php create mode 100644 app/src/Entity/NewsType.php create mode 100644 app/src/Entity/RestaurantTypes.php create mode 100644 app/src/Entity/Restaurants.php create mode 100644 app/src/Entity/Settlements.php create mode 100644 app/src/Entity/Users.php create mode 100644 app/src/Repository/KitchensRepository.php create mode 100644 app/src/Repository/NewsCategoriesRepository.php create mode 100644 app/src/Repository/NewsRepository.php create mode 100644 app/src/Repository/NewsTypeRepository.php create mode 100644 app/src/Repository/RestaurantTypesRepository.php create mode 100644 app/src/Repository/RestaurantsRepository.php create mode 100644 app/src/Repository/SettlementsRepository.php create mode 100644 app/src/Repository/UsersRepository.php diff --git a/app/migrations/Version20240419135600.php b/app/migrations/Version20240419135600.php deleted file mode 100644 index 2502217..0000000 --- a/app/migrations/Version20240419135600.php +++ /dev/null @@ -1,148 +0,0 @@ -addSql('CREATE SEQUENCE address_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); - $this->addSql('CREATE SEQUENCE email_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); - $this->addSql('CREATE SEQUENCE kitchens_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); - $this->addSql('CREATE SEQUENCE news_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); - $this->addSql('CREATE SEQUENCE news_categories_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); - $this->addSql('CREATE SEQUENCE news_comments_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); - $this->addSql('CREATE SEQUENCE news_type_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); - $this->addSql('CREATE SEQUENCE phone_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); - $this->addSql('CREATE SEQUENCE restauran_types_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); - $this->addSql('CREATE SEQUENCE restaurants_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); - $this->addSql('CREATE SEQUENCE settlements_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); - $this->addSql('CREATE SEQUENCE tags_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); - $this->addSql('CREATE SEQUENCE users_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); - $this->addSql('CREATE TABLE address (id INT NOT NULL, restaurant_id_id INT NOT NULL, address VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE INDEX IDX_D4E6F8135592D86 ON address (restaurant_id_id)'); - $this->addSql('CREATE TABLE email (id INT NOT NULL, restaurant_id_id INT NOT NULL, email VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE INDEX IDX_E7927C7435592D86 ON email (restaurant_id_id)'); - $this->addSql('CREATE TABLE kitchens (id INT NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE TABLE news (id INT NOT NULL, type_id_id INT NOT NULL, code VARCHAR(255) NOT NULL, active BOOLEAN NOT NULL, create_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, update_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, sort INT NOT NULL, preview_image VARCHAR(255) DEFAULT NULL, detail_image VARCHAR(1000) DEFAULT NULL, preview_text VARCHAR(1000) DEFAULT NULL, detail_test VARCHAR(1000) DEFAULT NULL, main_page_render BOOLEAN NOT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE INDEX IDX_1DD39950714819A0 ON news (type_id_id)'); - $this->addSql('COMMENT ON COLUMN news.create_at IS \'(DC2Type:datetime_immutable)\''); - $this->addSql('CREATE TABLE news_categories (id INT NOT NULL, name VARCHAR(255) NOT NULL, code VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE TABLE news_comments (id INT NOT NULL, news_id_id INT NOT NULL, moderator_id_id INT DEFAULT NULL, user_id_id INT DEFAULT NULL, moderated BOOLEAN DEFAULT NULL, user_name VARCHAR(255) NOT NULL, test VARCHAR(1000) NOT NULL, create_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, update_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE INDEX IDX_16A0357B5FB1909 ON news_comments (news_id_id)'); - $this->addSql('CREATE INDEX IDX_16A0357BCEB712DF ON news_comments (moderator_id_id)'); - $this->addSql('CREATE INDEX IDX_16A0357B9D86650F ON news_comments (user_id_id)'); - $this->addSql('COMMENT ON COLUMN news_comments.create_at IS \'(DC2Type:datetime_immutable)\''); - $this->addSql('CREATE TABLE news_type (id INT NOT NULL, name VARCHAR(255) NOT NULL, code VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE TABLE phone (id INT NOT NULL, restaurant_id_id INT NOT NULL, phone_number VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE INDEX IDX_444F97DD35592D86 ON phone (restaurant_id_id)'); - $this->addSql('CREATE TABLE restauran_types (id INT NOT NULL, name VARCHAR(255) NOT NULL, code VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE TABLE restaurants (id INT NOT NULL, type_id_id INT NOT NULL, settlement_id_id INT NOT NULL, uuid UUID NOT NULL, name VARCHAR(255) NOT NULL, code VARCHAR(255) NOT NULL, active BOOLEAN NOT NULL, sort INT NOT NULL, create_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, update_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, coordinates TEXT NOT NULL, description VARCHAR(1000) DEFAULT NULL, recipe VARCHAR(255) DEFAULT NULL, recipe_info VARCHAR(1000) DEFAULT NULL, site VARCHAR(255) DEFAULT NULL, preview_image VARCHAR(255) DEFAULT NULL, detail_image VARCHAR(255) DEFAULT NULL, how_to_find VARCHAR(1000) DEFAULT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE INDEX IDX_AD837724714819A0 ON restaurants (type_id_id)'); - $this->addSql('CREATE INDEX IDX_AD83772445EC589B ON restaurants (settlement_id_id)'); - $this->addSql('COMMENT ON COLUMN restaurants.create_at IS \'(DC2Type:datetime_immutable)\''); - $this->addSql('COMMENT ON COLUMN restaurants.coordinates IS \'(DC2Type:array)\''); - $this->addSql('CREATE TABLE restaurants_kitchens (restaurants_id INT NOT NULL, kitchens_id INT NOT NULL, PRIMARY KEY(restaurants_id, kitchens_id))'); - $this->addSql('CREATE INDEX IDX_716464694DCA160A ON restaurants_kitchens (restaurants_id)'); - $this->addSql('CREATE INDEX IDX_71646469E043FCBC ON restaurants_kitchens (kitchens_id)'); - $this->addSql('CREATE TABLE settlements (id INT NOT NULL, uuid UUID NOT NULL, name VARCHAR(255) NOT NULL, code VARCHAR(255) NOT NULL, coordinates TEXT NOT NULL, create_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, update_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, PRIMARY KEY(id))'); - $this->addSql('COMMENT ON COLUMN settlements.coordinates IS \'(DC2Type:array)\''); - $this->addSql('COMMENT ON COLUMN settlements.create_at IS \'(DC2Type:datetime_immutable)\''); - $this->addSql('CREATE TABLE tags (id INT NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE TABLE tags_restaurants (tags_id INT NOT NULL, restaurants_id INT NOT NULL, PRIMARY KEY(tags_id, restaurants_id))'); - $this->addSql('CREATE INDEX IDX_7AEC1CD68D7B4FB4 ON tags_restaurants (tags_id)'); - $this->addSql('CREATE INDEX IDX_7AEC1CD64DCA160A ON tags_restaurants (restaurants_id)'); - $this->addSql('CREATE TABLE users (id INT NOT NULL, uuid UUID NOT NULL, name VARCHAR(255) NOT NULL, is_male BOOLEAN NOT NULL, birth_day TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, �ф�address VARCHAR(255) NOT NULL, surname VARCHAR(255) NOT NULL, phone_number VARCHAR(255) DEFAULT NULL, email VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))'); - $this->addSql('COMMENT ON COLUMN users.birth_day IS \'(DC2Type:datetime_immutable)\''); - $this->addSql('CREATE TABLE messenger_messages (id BIGSERIAL NOT NULL, body TEXT NOT NULL, headers TEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, available_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, delivered_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE INDEX IDX_75EA56E0FB7336F0 ON messenger_messages (queue_name)'); - $this->addSql('CREATE INDEX IDX_75EA56E0E3BD61CE ON messenger_messages (available_at)'); - $this->addSql('CREATE INDEX IDX_75EA56E016BA31DB ON messenger_messages (delivered_at)'); - $this->addSql('COMMENT ON COLUMN messenger_messages.created_at IS \'(DC2Type:datetime_immutable)\''); - $this->addSql('COMMENT ON COLUMN messenger_messages.available_at IS \'(DC2Type:datetime_immutable)\''); - $this->addSql('COMMENT ON COLUMN messenger_messages.delivered_at IS \'(DC2Type:datetime_immutable)\''); - $this->addSql('CREATE OR REPLACE FUNCTION notify_messenger_messages() RETURNS TRIGGER AS $$ - BEGIN - PERFORM pg_notify(\'messenger_messages\', NEW.queue_name::text); - RETURN NEW; - END; - $$ LANGUAGE plpgsql;'); - $this->addSql('DROP TRIGGER IF EXISTS notify_trigger ON messenger_messages;'); - $this->addSql('CREATE TRIGGER notify_trigger AFTER INSERT OR UPDATE ON messenger_messages FOR EACH ROW EXECUTE PROCEDURE notify_messenger_messages();'); - $this->addSql('ALTER TABLE address ADD CONSTRAINT FK_D4E6F8135592D86 FOREIGN KEY (restaurant_id_id) REFERENCES restaurants (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE email ADD CONSTRAINT FK_E7927C7435592D86 FOREIGN KEY (restaurant_id_id) REFERENCES restaurants (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE news ADD CONSTRAINT FK_1DD39950714819A0 FOREIGN KEY (type_id_id) REFERENCES news_type (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE news_comments ADD CONSTRAINT FK_16A0357B5FB1909 FOREIGN KEY (news_id_id) REFERENCES news (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE news_comments ADD CONSTRAINT FK_16A0357BCEB712DF FOREIGN KEY (moderator_id_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE news_comments ADD CONSTRAINT FK_16A0357B9D86650F FOREIGN KEY (user_id_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE phone ADD CONSTRAINT FK_444F97DD35592D86 FOREIGN KEY (restaurant_id_id) REFERENCES restaurants (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE restaurants ADD CONSTRAINT FK_AD837724714819A0 FOREIGN KEY (type_id_id) REFERENCES restauran_types (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE restaurants ADD CONSTRAINT FK_AD83772445EC589B FOREIGN KEY (settlement_id_id) REFERENCES settlements (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE restaurants_kitchens ADD CONSTRAINT FK_716464694DCA160A FOREIGN KEY (restaurants_id) REFERENCES restaurants (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE restaurants_kitchens ADD CONSTRAINT FK_71646469E043FCBC FOREIGN KEY (kitchens_id) REFERENCES kitchens (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE tags_restaurants ADD CONSTRAINT FK_7AEC1CD68D7B4FB4 FOREIGN KEY (tags_id) REFERENCES tags (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE tags_restaurants ADD CONSTRAINT FK_7AEC1CD64DCA160A FOREIGN KEY (restaurants_id) REFERENCES restaurants (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('CREATE SCHEMA public'); - $this->addSql('DROP SEQUENCE address_id_seq CASCADE'); - $this->addSql('DROP SEQUENCE email_id_seq CASCADE'); - $this->addSql('DROP SEQUENCE kitchens_id_seq CASCADE'); - $this->addSql('DROP SEQUENCE news_id_seq CASCADE'); - $this->addSql('DROP SEQUENCE news_categories_id_seq CASCADE'); - $this->addSql('DROP SEQUENCE news_comments_id_seq CASCADE'); - $this->addSql('DROP SEQUENCE news_type_id_seq CASCADE'); - $this->addSql('DROP SEQUENCE phone_id_seq CASCADE'); - $this->addSql('DROP SEQUENCE restauran_types_id_seq CASCADE'); - $this->addSql('DROP SEQUENCE restaurants_id_seq CASCADE'); - $this->addSql('DROP SEQUENCE settlements_id_seq CASCADE'); - $this->addSql('DROP SEQUENCE tags_id_seq CASCADE'); - $this->addSql('DROP SEQUENCE users_id_seq CASCADE'); - $this->addSql('ALTER TABLE address DROP CONSTRAINT FK_D4E6F8135592D86'); - $this->addSql('ALTER TABLE email DROP CONSTRAINT FK_E7927C7435592D86'); - $this->addSql('ALTER TABLE news DROP CONSTRAINT FK_1DD39950714819A0'); - $this->addSql('ALTER TABLE news_comments DROP CONSTRAINT FK_16A0357B5FB1909'); - $this->addSql('ALTER TABLE news_comments DROP CONSTRAINT FK_16A0357BCEB712DF'); - $this->addSql('ALTER TABLE news_comments DROP CONSTRAINT FK_16A0357B9D86650F'); - $this->addSql('ALTER TABLE phone DROP CONSTRAINT FK_444F97DD35592D86'); - $this->addSql('ALTER TABLE restaurants DROP CONSTRAINT FK_AD837724714819A0'); - $this->addSql('ALTER TABLE restaurants DROP CONSTRAINT FK_AD83772445EC589B'); - $this->addSql('ALTER TABLE restaurants_kitchens DROP CONSTRAINT FK_716464694DCA160A'); - $this->addSql('ALTER TABLE restaurants_kitchens DROP CONSTRAINT FK_71646469E043FCBC'); - $this->addSql('ALTER TABLE tags_restaurants DROP CONSTRAINT FK_7AEC1CD68D7B4FB4'); - $this->addSql('ALTER TABLE tags_restaurants DROP CONSTRAINT FK_7AEC1CD64DCA160A'); - $this->addSql('DROP TABLE address'); - $this->addSql('DROP TABLE email'); - $this->addSql('DROP TABLE kitchens'); - $this->addSql('DROP TABLE news'); - $this->addSql('DROP TABLE news_categories'); - $this->addSql('DROP TABLE news_comments'); - $this->addSql('DROP TABLE news_type'); - $this->addSql('DROP TABLE phone'); - $this->addSql('DROP TABLE restauran_types'); - $this->addSql('DROP TABLE restaurants'); - $this->addSql('DROP TABLE restaurants_kitchens'); - $this->addSql('DROP TABLE settlements'); - $this->addSql('DROP TABLE tags'); - $this->addSql('DROP TABLE tags_restaurants'); - $this->addSql('DROP TABLE users'); - $this->addSql('DROP TABLE messenger_messages'); - } -} diff --git a/app/migrations/Version20240427114630.php b/app/migrations/Version20240427114630.php new file mode 100644 index 0000000..84378b7 --- /dev/null +++ b/app/migrations/Version20240427114630.php @@ -0,0 +1,96 @@ +addSql('CREATE TABLE kitchens (id UUID NOT NULL, name VARCHAR(255) NOT NULL, code VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE news (id UUID NOT NULL, type_id UUID DEFAULT NULL, name VARCHAR(255) NOT NULL, code VARCHAR(255) NOT NULL, sort INT NOT NULL, active BOOLEAN NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, update_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, preview_image VARCHAR(255) DEFAULT NULL, preview_text VARCHAR(1000) DEFAULT NULL, detail_image VARCHAR(255) DEFAULT NULL, detail_text VARCHAR(255) DEFAULT NULL, main_page_render BOOLEAN NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX IDX_1DD39950C54C8C93 ON news (type_id)'); + $this->addSql('COMMENT ON COLUMN news.created_at IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('COMMENT ON COLUMN news.update_at IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('CREATE TABLE news_news_categories (news_id UUID NOT NULL, news_categories_id UUID NOT NULL, PRIMARY KEY(news_id, news_categories_id))'); + $this->addSql('CREATE INDEX IDX_34AB0102B5A459A0 ON news_news_categories (news_id)'); + $this->addSql('CREATE INDEX IDX_34AB0102F7F178F1 ON news_news_categories (news_categories_id)'); + $this->addSql('CREATE TABLE news_categories (id UUID NOT NULL, name VARCHAR(255) NOT NULL, code VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE news_type (id UUID NOT NULL, name VARCHAR(255) NOT NULL, code VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE restaurant_types (id UUID NOT NULL, name VARCHAR(255) NOT NULL, code VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE restaurants (id UUID NOT NULL, type_id UUID DEFAULT NULL, settlement_id UUID DEFAULT NULL, active BOOLEAN NOT NULL, sort INT NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, update_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, name VARCHAR(255) NOT NULL, code VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, receipt VARCHAR(255) NOT NULL, receipt_info VARCHAR(255) NOT NULL, phone VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, address VARCHAR(255) NOT NULL, tags VARCHAR(255) NOT NULL, site VARCHAR(255) NOT NULL, coordinates TEXT NOT NULL, preview_image VARCHAR(255) NOT NULL, detail_image VARCHAR(255) NOT NULL, gallery VARCHAR(255) NOT NULL, how_to_find VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX IDX_AD837724C54C8C93 ON restaurants (type_id)'); + $this->addSql('CREATE INDEX IDX_AD837724C2B9C425 ON restaurants (settlement_id)'); + $this->addSql('COMMENT ON COLUMN restaurants.created_at IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('COMMENT ON COLUMN restaurants.update_at IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('COMMENT ON COLUMN restaurants.coordinates IS \'(DC2Type:array)\''); + $this->addSql('CREATE TABLE restaurants_kitchens (restaurants_id UUID NOT NULL, kitchens_id UUID NOT NULL, PRIMARY KEY(restaurants_id, kitchens_id))'); + $this->addSql('CREATE INDEX IDX_716464694DCA160A ON restaurants_kitchens (restaurants_id)'); + $this->addSql('CREATE INDEX IDX_71646469E043FCBC ON restaurants_kitchens (kitchens_id)'); + $this->addSql('CREATE TABLE settlements (id UUID NOT NULL, active BOOLEAN NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, update_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, name VARCHAR(255) NOT NULL, code VARCHAR(255) NOT NULL, coordinates TEXT NOT NULL, PRIMARY KEY(id))'); + $this->addSql('COMMENT ON COLUMN settlements.created_at IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('COMMENT ON COLUMN settlements.update_at IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('COMMENT ON COLUMN settlements.coordinates IS \'(DC2Type:array)\''); + $this->addSql('CREATE TABLE users (id UUID NOT NULL, name VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, phone VARCHAR(255) NOT NULL, is_male BOOLEAN NOT NULL, address VARCHAR(255) NOT NULL, birthday DATE NOT NULL, PRIMARY KEY(id))'); + $this->addSql('COMMENT ON COLUMN users.birthday IS \'(DC2Type:date_immutable)\''); + $this->addSql('CREATE TABLE messenger_messages (id BIGSERIAL NOT NULL, body TEXT NOT NULL, headers TEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, available_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, delivered_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX IDX_75EA56E0FB7336F0 ON messenger_messages (queue_name)'); + $this->addSql('CREATE INDEX IDX_75EA56E0E3BD61CE ON messenger_messages (available_at)'); + $this->addSql('CREATE INDEX IDX_75EA56E016BA31DB ON messenger_messages (delivered_at)'); + $this->addSql('COMMENT ON COLUMN messenger_messages.created_at IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('COMMENT ON COLUMN messenger_messages.available_at IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('COMMENT ON COLUMN messenger_messages.delivered_at IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('CREATE OR REPLACE FUNCTION notify_messenger_messages() RETURNS TRIGGER AS $$ + BEGIN + PERFORM pg_notify(\'messenger_messages\', NEW.queue_name::text); + RETURN NEW; + END; + $$ LANGUAGE plpgsql;'); + $this->addSql('DROP TRIGGER IF EXISTS notify_trigger ON messenger_messages;'); + $this->addSql('CREATE TRIGGER notify_trigger AFTER INSERT OR UPDATE ON messenger_messages FOR EACH ROW EXECUTE PROCEDURE notify_messenger_messages();'); + $this->addSql('ALTER TABLE news ADD CONSTRAINT FK_1DD39950C54C8C93 FOREIGN KEY (type_id) REFERENCES news_type (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE news_news_categories ADD CONSTRAINT FK_34AB0102B5A459A0 FOREIGN KEY (news_id) REFERENCES news (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE news_news_categories ADD CONSTRAINT FK_34AB0102F7F178F1 FOREIGN KEY (news_categories_id) REFERENCES news_categories (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE restaurants ADD CONSTRAINT FK_AD837724C54C8C93 FOREIGN KEY (type_id) REFERENCES restaurant_types (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE restaurants ADD CONSTRAINT FK_AD837724C2B9C425 FOREIGN KEY (settlement_id) REFERENCES settlements (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE restaurants_kitchens ADD CONSTRAINT FK_716464694DCA160A FOREIGN KEY (restaurants_id) REFERENCES restaurants (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE restaurants_kitchens ADD CONSTRAINT FK_71646469E043FCBC FOREIGN KEY (kitchens_id) REFERENCES kitchens (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('CREATE SCHEMA public'); + $this->addSql('ALTER TABLE news DROP CONSTRAINT FK_1DD39950C54C8C93'); + $this->addSql('ALTER TABLE news_news_categories DROP CONSTRAINT FK_34AB0102B5A459A0'); + $this->addSql('ALTER TABLE news_news_categories DROP CONSTRAINT FK_34AB0102F7F178F1'); + $this->addSql('ALTER TABLE restaurants DROP CONSTRAINT FK_AD837724C54C8C93'); + $this->addSql('ALTER TABLE restaurants DROP CONSTRAINT FK_AD837724C2B9C425'); + $this->addSql('ALTER TABLE restaurants_kitchens DROP CONSTRAINT FK_716464694DCA160A'); + $this->addSql('ALTER TABLE restaurants_kitchens DROP CONSTRAINT FK_71646469E043FCBC'); + $this->addSql('DROP TABLE kitchens'); + $this->addSql('DROP TABLE news'); + $this->addSql('DROP TABLE news_news_categories'); + $this->addSql('DROP TABLE news_categories'); + $this->addSql('DROP TABLE news_type'); + $this->addSql('DROP TABLE restaurant_types'); + $this->addSql('DROP TABLE restaurants'); + $this->addSql('DROP TABLE restaurants_kitchens'); + $this->addSql('DROP TABLE settlements'); + $this->addSql('DROP TABLE users'); + $this->addSql('DROP TABLE messenger_messages'); + } +} diff --git a/app/src/Entity/Kitchens.php b/app/src/Entity/Kitchens.php new file mode 100644 index 0000000..29ac790 --- /dev/null +++ b/app/src/Entity/Kitchens.php @@ -0,0 +1,97 @@ + + */ + #[ORM\ManyToMany(targetEntity: Restaurants::class, mappedBy: 'kitchens')] + private Collection $restaurants; + + public function __construct() + { + $this->restaurants = new ArrayCollection(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function setId(string $id): static + { + $this->id = $id; + + return $this; + } + + public function getName(): ?string + { + return $this->name; + } + + public function setName(string $name): static + { + $this->name = $name; + + return $this; + } + + public function getCode(): ?string + { + return $this->code; + } + + public function setCode(string $code): static + { + $this->code = $code; + + return $this; + } + + /** + * @return Collection + */ + public function getRestaurants(): Collection + { + return $this->restaurants; + } + + public function addRestaurant(Restaurants $restaurant): static + { + if (!$this->restaurants->contains($restaurant)) { + $this->restaurants->add($restaurant); + $restaurant->addKitchen($this); + } + + return $this; + } + + public function removeRestaurant(Restaurants $restaurant): static + { + if ($this->restaurants->removeElement($restaurant)) { + $restaurant->removeKitchen($this); + } + + return $this; + } +} diff --git a/app/src/Entity/News.php b/app/src/Entity/News.php new file mode 100644 index 0000000..cd6d609 --- /dev/null +++ b/app/src/Entity/News.php @@ -0,0 +1,246 @@ + + */ + #[ORM\ManyToMany(targetEntity: NewsCategories::class, inversedBy: 'news')] + private Collection $categories; + + #[ORM\Column] + private ?bool $mainPageRender = null; + + + + public function __construct() + { + $this->categories = new ArrayCollection(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function setId(string $id): static + { + $this->id = $id; + + return $this; + } + + public function getName(): ?string + { + return $this->name; + } + + public function setName(string $name): static + { + $this->name = $name; + + return $this; + } + + public function getCode(): ?string + { + return $this->code; + } + + public function setCode(string $code): static + { + $this->code = $code; + + return $this; + } + + public function getSort(): ?int + { + return $this->sort; + } + + public function setSort(int $sort): static + { + $this->sort = $sort; + + return $this; + } + + public function isActive(): ?bool + { + return $this->active; + } + + public function setActive(bool $active): static + { + $this->active = $active; + + return $this; + } + + public function getCreatedAt(): ?\DateTimeImmutable + { + return $this->createdAt; + } + + public function setCreatedAt(\DateTimeImmutable $createdAt): static + { + $this->createdAt = $createdAt; + + return $this; + } + + public function getUpdateAt(): ?\DateTimeImmutable + { + return $this->updateAt; + } + + public function setUpdateAt(\DateTimeImmutable $updateAt): static + { + $this->updateAt = $updateAt; + + return $this; + } + + public function getPreviewImage(): ?string + { + return $this->previewImage; + } + + public function setPreviewImage(?string $previewImage): static + { + $this->previewImage = $previewImage; + + return $this; + } + + public function getPreviewText(): ?string + { + return $this->previewText; + } + + public function setPreviewText(?string $previewText): static + { + $this->previewText = $previewText; + + return $this; + } + + public function getDetailImage(): ?string + { + return $this->detailImage; + } + + public function setDetailImage(?string $detailImage): static + { + $this->detailImage = $detailImage; + + return $this; + } + + public function getDetailText(): ?string + { + return $this->detailText; + } + + public function setDetailText(?string $detailText): static + { + $this->detailText = $detailText; + + return $this; + } + + public function getType(): ?NewsType + { + return $this->type; + } + + public function setType(?NewsType $type): static + { + $this->type = $type; + + return $this; + } + + /** + * @return Collection + */ + public function getCategories(): Collection + { + return $this->categories; + } + + public function addCategory(NewsCategories $category): static + { + if (!$this->categories->contains($category)) { + $this->categories->add($category); + } + + return $this; + } + + public function removeCategory(NewsCategories $category): static + { + $this->categories->removeElement($category); + + return $this; + } + + public function isMainPageRender(): ?bool + { + return $this->mainPageRender; + } + + public function setMainPageRender(bool $mainPageRender): static + { + $this->mainPageRender = $mainPageRender; + + return $this; + } +} diff --git a/app/src/Entity/NewsCategories.php b/app/src/Entity/NewsCategories.php new file mode 100644 index 0000000..aa5bf02 --- /dev/null +++ b/app/src/Entity/NewsCategories.php @@ -0,0 +1,97 @@ + + */ + #[ORM\ManyToMany(targetEntity: News::class, mappedBy: 'categories')] + private Collection $news; + + public function __construct() + { + $this->news = new ArrayCollection(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function setId(string $id): static + { + $this->id = $id; + + return $this; + } + + public function getName(): ?string + { + return $this->name; + } + + public function setName(string $name): static + { + $this->name = $name; + + return $this; + } + + public function getCode(): ?string + { + return $this->code; + } + + public function setCode(string $code): static + { + $this->code = $code; + + return $this; + } + + /** + * @return Collection + */ + public function getNews(): Collection + { + return $this->news; + } + + public function addNews(News $news): static + { + if (!$this->news->contains($news)) { + $this->news->add($news); + $news->addCategory($this); + } + + return $this; + } + + public function removeNews(News $news): static + { + if ($this->news->removeElement($news)) { + $news->removeCategory($this); + } + + return $this; + } +} diff --git a/app/src/Entity/NewsType.php b/app/src/Entity/NewsType.php new file mode 100644 index 0000000..f5764f2 --- /dev/null +++ b/app/src/Entity/NewsType.php @@ -0,0 +1,100 @@ + + */ + #[ORM\OneToMany(targetEntity: News::class, mappedBy: 'type')] + private Collection $news; + + public function __construct() + { + $this->news = new ArrayCollection(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function setId(string $id): static + { + $this->id = $id; + + return $this; + } + + public function getName(): ?string + { + return $this->name; + } + + public function setName(string $name): static + { + $this->name = $name; + + return $this; + } + + public function getCode(): ?string + { + return $this->code; + } + + public function setCode(string $code): static + { + $this->code = $code; + + return $this; + } + + /** + * @return Collection + */ + public function getNews(): Collection + { + return $this->news; + } + + public function addNews(News $news): static + { + if (!$this->news->contains($news)) { + $this->news->add($news); + $news->setType($this); + } + + return $this; + } + + public function removeNews(News $news): static + { + if ($this->news->removeElement($news)) { + // set the owning side to null (unless already changed) + if ($news->getType() === $this) { + $news->setType(null); + } + } + + return $this; + } +} diff --git a/app/src/Entity/RestaurantTypes.php b/app/src/Entity/RestaurantTypes.php new file mode 100644 index 0000000..fc3c1b0 --- /dev/null +++ b/app/src/Entity/RestaurantTypes.php @@ -0,0 +1,101 @@ + + */ + #[ORM\OneToMany(targetEntity: Restaurants::class, mappedBy: 'type')] + private Collection $restaurants; + + public function __construct() + { + $this->restaurants = new ArrayCollection(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function setId(string $id): static + { + $this->id = $id; + + return $this; + } + + public function getName(): ?string + { + return $this->name; + } + + public function setName(string $name): static + { + $this->name = $name; + + return $this; + } + + public function getCode(): ?string + { + return $this->code; + } + + public function setCode(string $code): static + { + $this->code = $code; + + return $this; + } + + /** + * @return Collection + */ + public function getRestaurants(): Collection + { + return $this->restaurants; + } + + public function addRestaurant(Restaurants $restaurant): static + { + if (!$this->restaurants->contains($restaurant)) { + $this->restaurants->add($restaurant); + $restaurant->setType($this); + } + + return $this; + } + + public function removeRestaurant(Restaurants $restaurant): static + { + if ($this->restaurants->removeElement($restaurant)) { + // set the owning side to null (unless already changed) + if ($restaurant->getType() === $this) { + $restaurant->setType(null); + } + } + + return $this; + } +} diff --git a/app/src/Entity/Restaurants.php b/app/src/Entity/Restaurants.php new file mode 100644 index 0000000..4419b81 --- /dev/null +++ b/app/src/Entity/Restaurants.php @@ -0,0 +1,379 @@ + + */ + #[ORM\ManyToMany(targetEntity: Kitchens::class, inversedBy: 'restaurants')] + private Collection $kitchens; + + public function __construct() + { + $this->kitchens = new ArrayCollection(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function setId(string $id): static + { + $this->id = $id; + + return $this; + } + + public function isActive(): ?bool + { + return $this->active; + } + + public function setActive(bool $active): static + { + $this->active = $active; + + return $this; + } + + public function getSort(): ?int + { + return $this->sort; + } + + public function setSort(int $sort): static + { + $this->sort = $sort; + + return $this; + } + + public function getCreatedAt(): ?\DateTimeImmutable + { + return $this->createdAt; + } + + public function setCreatedAt(\DateTimeImmutable $createdAt): static + { + $this->createdAt = $createdAt; + + return $this; + } + + public function getUpdateAt(): ?\DateTimeImmutable + { + return $this->updateAt; + } + + public function setUpdateAt(\DateTimeImmutable $updateAt): static + { + $this->updateAt = $updateAt; + + return $this; + } + + public function getType(): ?RestaurantTypes + { + return $this->type; + } + + public function setType(?RestaurantTypes $type): static + { + $this->type = $type; + + return $this; + } + + public function getSettlement(): ?Settlements + { + return $this->settlement; + } + + public function setSettlement(?Settlements $settlement): static + { + $this->settlement = $settlement; + + return $this; + } + + public function getName(): ?string + { + return $this->name; + } + + public function setName(string $name): static + { + $this->name = $name; + + return $this; + } + + public function getCode(): ?string + { + return $this->code; + } + + public function setCode(string $code): static + { + $this->code = $code; + + return $this; + } + + public function getDescription(): ?string + { + return $this->description; + } + + public function setDescription(string $description): static + { + $this->description = $description; + + return $this; + } + + public function getReceipt(): ?string + { + return $this->receipt; + } + + public function setReceipt(string $receipt): static + { + $this->receipt = $receipt; + + return $this; + } + + public function getReceiptInfo(): ?string + { + return $this->receiptInfo; + } + + public function setReceiptInfo(string $receiptInfo): static + { + $this->receiptInfo = $receiptInfo; + + return $this; + } + + public function getPhone(): ?string + { + return $this->phone; + } + + public function setPhone(string $phone): static + { + $this->phone = $phone; + + return $this; + } + + public function getEmail(): ?string + { + return $this->email; + } + + public function setEmail(string $email): static + { + $this->email = $email; + + return $this; + } + + public function getAddress(): ?string + { + return $this->address; + } + + public function setAddress(string $address): static + { + $this->address = $address; + + return $this; + } + + public function getTags(): ?string + { + return $this->tags; + } + + public function setTags(string $tags): static + { + $this->tags = $tags; + + return $this; + } + + public function getSite(): ?string + { + return $this->site; + } + + public function setSite(string $site): static + { + $this->site = $site; + + return $this; + } + + public function getCoordinates(): array + { + return $this->coordinates; + } + + public function setCoordinates(array $coordinates): static + { + $this->coordinates = $coordinates; + + return $this; + } + + public function getPreviewImage(): ?string + { + return $this->previewImage; + } + + public function setPreviewImage(string $previewImage): static + { + $this->previewImage = $previewImage; + + return $this; + } + + public function getDetailImage(): ?string + { + return $this->detailImage; + } + + public function setDetailImage(string $detailImage): static + { + $this->detailImage = $detailImage; + + return $this; + } + + public function getGallery(): ?string + { + return $this->gallery; + } + + public function setGallery(string $gallery): static + { + $this->gallery = $gallery; + + return $this; + } + + public function getHowToFind(): ?string + { + return $this->howToFind; + } + + public function setHowToFind(string $howToFind): static + { + $this->howToFind = $howToFind; + + return $this; + } + + /** + * @return Collection + */ + public function getKitchens(): Collection + { + return $this->kitchens; + } + + public function addKitchen(Kitchens $kitchen): static + { + if (!$this->kitchens->contains($kitchen)) { + $this->kitchens->add($kitchen); + } + + return $this; + } + + public function removeKitchen(Kitchens $kitchen): static + { + $this->kitchens->removeElement($kitchen); + + return $this; + } +} diff --git a/app/src/Entity/Settlements.php b/app/src/Entity/Settlements.php new file mode 100644 index 0000000..304a26c --- /dev/null +++ b/app/src/Entity/Settlements.php @@ -0,0 +1,160 @@ + + */ + #[ORM\OneToMany(targetEntity: Restaurants::class, mappedBy: 'settlement')] + private Collection $restaurants; + + public function __construct() + { + $this->restaurants = new ArrayCollection(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function setId(string $id): static + { + $this->id = $id; + + return $this; + } + + public function isActive(): ?bool + { + return $this->active; + } + + public function setActive(bool $active): static + { + $this->active = $active; + + return $this; + } + + public function getCreatedAt(): ?\DateTimeImmutable + { + return $this->createdAt; + } + + public function setCreatedAt(\DateTimeImmutable $createdAt): static + { + $this->createdAt = $createdAt; + + return $this; + } + + public function getUpdateAt(): ?\DateTimeImmutable + { + return $this->updateAt; + } + + public function setUpdateAt(\DateTimeImmutable $updateAt): static + { + $this->updateAt = $updateAt; + + return $this; + } + + public function getName(): ?string + { + return $this->name; + } + + public function setName(string $name): static + { + $this->name = $name; + + return $this; + } + + public function getCode(): ?string + { + return $this->code; + } + + public function setCode(string $code): static + { + $this->code = $code; + + return $this; + } + + public function getCoordinates(): array + { + return $this->coordinates; + } + + public function setCoordinates(array $coordinates): static + { + $this->coordinates = $coordinates; + + return $this; + } + + /** + * @return Collection + */ + public function getRestaurants(): Collection + { + return $this->restaurants; + } + + public function addRestaurant(Restaurants $restaurant): static + { + if (!$this->restaurants->contains($restaurant)) { + $this->restaurants->add($restaurant); + $restaurant->setSettlement($this); + } + + return $this; + } + + public function removeRestaurant(Restaurants $restaurant): static + { + if ($this->restaurants->removeElement($restaurant)) { + // set the owning side to null (unless already changed) + if ($restaurant->getSettlement() === $this) { + $restaurant->setSettlement(null); + } + } + + return $this; + } +} diff --git a/app/src/Entity/Users.php b/app/src/Entity/Users.php new file mode 100644 index 0000000..6c8ef97 --- /dev/null +++ b/app/src/Entity/Users.php @@ -0,0 +1,117 @@ +id; + } + + public function setId(string $id): static + { + $this->id = $id; + + return $this; + } + + public function getName(): ?string + { + return $this->name; + } + + public function setName(string $name): static + { + $this->name = $name; + + return $this; + } + + public function getEmail(): ?string + { + return $this->email; + } + + public function setEmail(string $email): static + { + $this->email = $email; + + return $this; + } + + public function getPhone(): ?string + { + return $this->phone; + } + + public function setPhone(string $phone): static + { + $this->phone = $phone; + + return $this; + } + + public function isMale(): ?bool + { + return $this->isMale; + } + + public function setMale(bool $isMale): static + { + $this->isMale = $isMale; + + return $this; + } + + public function getAddress(): ?string + { + return $this->address; + } + + public function setAddress(string $address): static + { + $this->address = $address; + + return $this; + } + + public function getBirthday(): ?\DateTimeImmutable + { + return $this->birthday; + } + + public function setBirthday(\DateTimeImmutable $birthday): static + { + $this->birthday = $birthday; + + return $this; + } +} diff --git a/app/src/Repository/KitchensRepository.php b/app/src/Repository/KitchensRepository.php new file mode 100644 index 0000000..b65972f --- /dev/null +++ b/app/src/Repository/KitchensRepository.php @@ -0,0 +1,48 @@ + + * + * @method Kitchens|null find($id, $lockMode = null, $lockVersion = null) + * @method Kitchens|null findOneBy(array $criteria, array $orderBy = null) + * @method Kitchens[] findAll() + * @method Kitchens[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class KitchensRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Kitchens::class); + } + + // /** + // * @return Kitchens[] Returns an array of Kitchens objects + // */ + // public function findByExampleField($value): array + // { + // return $this->createQueryBuilder('k') + // ->andWhere('k.exampleField = :val') + // ->setParameter('val', $value) + // ->orderBy('k.id', 'ASC') + // ->setMaxResults(10) + // ->getQuery() + // ->getResult() + // ; + // } + + // public function findOneBySomeField($value): ?Kitchens + // { + // return $this->createQueryBuilder('k') + // ->andWhere('k.exampleField = :val') + // ->setParameter('val', $value) + // ->getQuery() + // ->getOneOrNullResult() + // ; + // } +} diff --git a/app/src/Repository/NewsCategoriesRepository.php b/app/src/Repository/NewsCategoriesRepository.php new file mode 100644 index 0000000..cb2bf88 --- /dev/null +++ b/app/src/Repository/NewsCategoriesRepository.php @@ -0,0 +1,48 @@ + + * + * @method NewsCategories|null find($id, $lockMode = null, $lockVersion = null) + * @method NewsCategories|null findOneBy(array $criteria, array $orderBy = null) + * @method NewsCategories[] findAll() + * @method NewsCategories[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class NewsCategoriesRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, NewsCategories::class); + } + + // /** + // * @return NewsCategories[] Returns an array of NewsCategories objects + // */ + // public function findByExampleField($value): array + // { + // return $this->createQueryBuilder('n') + // ->andWhere('n.exampleField = :val') + // ->setParameter('val', $value) + // ->orderBy('n.id', 'ASC') + // ->setMaxResults(10) + // ->getQuery() + // ->getResult() + // ; + // } + + // public function findOneBySomeField($value): ?NewsCategories + // { + // return $this->createQueryBuilder('n') + // ->andWhere('n.exampleField = :val') + // ->setParameter('val', $value) + // ->getQuery() + // ->getOneOrNullResult() + // ; + // } +} diff --git a/app/src/Repository/NewsRepository.php b/app/src/Repository/NewsRepository.php new file mode 100644 index 0000000..c74af62 --- /dev/null +++ b/app/src/Repository/NewsRepository.php @@ -0,0 +1,48 @@ + + * + * @method News|null find($id, $lockMode = null, $lockVersion = null) + * @method News|null findOneBy(array $criteria, array $orderBy = null) + * @method News[] findAll() + * @method News[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class NewsRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, News::class); + } + + // /** + // * @return News[] Returns an array of News objects + // */ + // public function findByExampleField($value): array + // { + // return $this->createQueryBuilder('n') + // ->andWhere('n.exampleField = :val') + // ->setParameter('val', $value) + // ->orderBy('n.id', 'ASC') + // ->setMaxResults(10) + // ->getQuery() + // ->getResult() + // ; + // } + + // public function findOneBySomeField($value): ?News + // { + // return $this->createQueryBuilder('n') + // ->andWhere('n.exampleField = :val') + // ->setParameter('val', $value) + // ->getQuery() + // ->getOneOrNullResult() + // ; + // } +} diff --git a/app/src/Repository/NewsTypeRepository.php b/app/src/Repository/NewsTypeRepository.php new file mode 100644 index 0000000..dabf301 --- /dev/null +++ b/app/src/Repository/NewsTypeRepository.php @@ -0,0 +1,48 @@ + + * + * @method NewsType|null find($id, $lockMode = null, $lockVersion = null) + * @method NewsType|null findOneBy(array $criteria, array $orderBy = null) + * @method NewsType[] findAll() + * @method NewsType[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class NewsTypeRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, NewsType::class); + } + + // /** + // * @return NewsType[] Returns an array of NewsType objects + // */ + // public function findByExampleField($value): array + // { + // return $this->createQueryBuilder('n') + // ->andWhere('n.exampleField = :val') + // ->setParameter('val', $value) + // ->orderBy('n.id', 'ASC') + // ->setMaxResults(10) + // ->getQuery() + // ->getResult() + // ; + // } + + // public function findOneBySomeField($value): ?NewsType + // { + // return $this->createQueryBuilder('n') + // ->andWhere('n.exampleField = :val') + // ->setParameter('val', $value) + // ->getQuery() + // ->getOneOrNullResult() + // ; + // } +} diff --git a/app/src/Repository/RestaurantTypesRepository.php b/app/src/Repository/RestaurantTypesRepository.php new file mode 100644 index 0000000..8a2f3c3 --- /dev/null +++ b/app/src/Repository/RestaurantTypesRepository.php @@ -0,0 +1,48 @@ + + * + * @method RestaurantTypes|null find($id, $lockMode = null, $lockVersion = null) + * @method RestaurantTypes|null findOneBy(array $criteria, array $orderBy = null) + * @method RestaurantTypes[] findAll() + * @method RestaurantTypes[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class RestaurantTypesRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, RestaurantTypes::class); + } + + // /** + // * @return RestaurantTypes[] Returns an array of RestaurantTypes objects + // */ + // public function findByExampleField($value): array + // { + // return $this->createQueryBuilder('r') + // ->andWhere('r.exampleField = :val') + // ->setParameter('val', $value) + // ->orderBy('r.id', 'ASC') + // ->setMaxResults(10) + // ->getQuery() + // ->getResult() + // ; + // } + + // public function findOneBySomeField($value): ?RestaurantTypes + // { + // return $this->createQueryBuilder('r') + // ->andWhere('r.exampleField = :val') + // ->setParameter('val', $value) + // ->getQuery() + // ->getOneOrNullResult() + // ; + // } +} diff --git a/app/src/Repository/RestaurantsRepository.php b/app/src/Repository/RestaurantsRepository.php new file mode 100644 index 0000000..f540695 --- /dev/null +++ b/app/src/Repository/RestaurantsRepository.php @@ -0,0 +1,48 @@ + + * + * @method Restaurants|null find($id, $lockMode = null, $lockVersion = null) + * @method Restaurants|null findOneBy(array $criteria, array $orderBy = null) + * @method Restaurants[] findAll() + * @method Restaurants[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class RestaurantsRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Restaurants::class); + } + +// /** +// * @return Restaurants[] Returns an array of Restaurants objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('r') +// ->andWhere('r.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('r.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?Restaurants +// { +// return $this->createQueryBuilder('r') +// ->andWhere('r.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/app/src/Repository/SettlementsRepository.php b/app/src/Repository/SettlementsRepository.php new file mode 100644 index 0000000..4e84a18 --- /dev/null +++ b/app/src/Repository/SettlementsRepository.php @@ -0,0 +1,48 @@ + + * + * @method Settlements|null find($id, $lockMode = null, $lockVersion = null) + * @method Settlements|null findOneBy(array $criteria, array $orderBy = null) + * @method Settlements[] findAll() + * @method Settlements[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class SettlementsRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Settlements::class); + } + + // /** + // * @return Settlements[] Returns an array of Settlements objects + // */ + // public function findByExampleField($value): array + // { + // return $this->createQueryBuilder('s') + // ->andWhere('s.exampleField = :val') + // ->setParameter('val', $value) + // ->orderBy('s.id', 'ASC') + // ->setMaxResults(10) + // ->getQuery() + // ->getResult() + // ; + // } + + // public function findOneBySomeField($value): ?Settlements + // { + // return $this->createQueryBuilder('s') + // ->andWhere('s.exampleField = :val') + // ->setParameter('val', $value) + // ->getQuery() + // ->getOneOrNullResult() + // ; + // } +} diff --git a/app/src/Repository/UsersRepository.php b/app/src/Repository/UsersRepository.php new file mode 100644 index 0000000..a151d1b --- /dev/null +++ b/app/src/Repository/UsersRepository.php @@ -0,0 +1,48 @@ + + * + * @method Users|null find($id, $lockMode = null, $lockVersion = null) + * @method Users|null findOneBy(array $criteria, array $orderBy = null) + * @method Users[] findAll() + * @method Users[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class UsersRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Users::class); + } + + // /** + // * @return Users[] Returns an array of Users objects + // */ + // public function findByExampleField($value): array + // { + // return $this->createQueryBuilder('u') + // ->andWhere('u.exampleField = :val') + // ->setParameter('val', $value) + // ->orderBy('u.id', 'ASC') + // ->setMaxResults(10) + // ->getQuery() + // ->getResult() + // ; + // } + + // public function findOneBySomeField($value): ?Users + // { + // return $this->createQueryBuilder('u') + // ->andWhere('u.exampleField = :val') + // ->setParameter('val', $value) + // ->getQuery() + // ->getOneOrNullResult() + // ; + // } +} -- GitLab