Loading app/src/News/Service/NewsPrepareResponseService.php +2 −2 Original line number Diff line number Diff line Loading @@ -10,13 +10,13 @@ use App\News\DtoFactory\NewsDetailElementDtoFactory; use App\News\DtoFactory\NewsFilterVariantsDtoFactory; use App\News\DtoFactory\NewsListDtoFactory; use App\News\DtoFactory\NewsListingElementDtoFactory; use App\News\EntityFabric\NewsEntityFabric; use App\News\Request\NewsCreateRequest; use App\News\Request\NewsDetailRequest; use App\News\Request\NewsFullUpdateRequest; use App\News\Request\NewsListingRequest; use App\News\Request\NewsPartUpdateRequest; use App\Shared\DtoFactory\PaginationDtoFactory; use App\Shared\EntityFactory\NewsEntityFactory; use App\Shared\Error\NotFoundError; use App\Shared\Repository\NewsCategoriesRepository; use App\Shared\Repository\NewsRepository; Loading @@ -32,7 +32,7 @@ class NewsPrepareResponseService private readonly NewsListDtoFactory $listingFactory, private readonly NewsCategoryDtoFactory $categoryFactory, private readonly NewsDetailElementDtoFactory $detailElementFactory, private readonly NewsEntityFabric $entityFabric, private readonly NewsEntityFactory $entityFabric, ) { } Loading app/src/Shared/Entity/Restaurants.php +13 −0 Original line number Diff line number Diff line Loading @@ -393,4 +393,17 @@ class Restaurants return $this; } #[ORM\PrePersist] public function setCreatedAtValue(): void { $this->createdAt = new DateTimeImmutable(); $this->updateAt = new DateTimeImmutable(); } #[ORM\PreUpdate] public function setUpdateAtValue(): void { $this->updateAt = new DateTimeImmutable(); } } app/src/News/EntityFabric/NewsEntityFabric.php→app/src/Shared/EntityFactory/NewsEntityFactory.php +5 −4 Original line number Diff line number Diff line <?php namespace App\News\EntityFabric; namespace App\Shared\EntityFactory; use App\News\Request\NewsCreateRequest; use App\News\Request\NewsFullUpdateRequest; Loading @@ -14,7 +14,7 @@ use App\Shared\Repository\NewsTypeRepository; use Ramsey\Collection\Collection; use Ramsey\Uuid\Uuid; class NewsEntityFabric class NewsEntityFactory { /** @var Collection<callable> */ private readonly Collection $newsSetters; Loading @@ -25,7 +25,7 @@ class NewsEntityFabric private readonly NewsCategoriesRepository $categoriesRepository, private readonly FileRepository $fileRepository, ) { $this->newsSetters = $this->getSetters(); $this->newsSetters = $this->setNewsSetters(); } public function create(NewsCreateRequest $request): News Loading Loading @@ -72,7 +72,8 @@ class NewsEntityFabric return $news; } private function getSetters(): Collection /** @return Collection<callable> */ private function setNewsSetters(): Collection { $newsSetters = new Collection('callable'); Loading app/src/Shared/EntityFactory/RestaurantEntityFactory.php 0 → 100644 +17 −0 Original line number Diff line number Diff line <?php namespace App\Shared\EntityFactory; use Ramsey\Collection\Collection; class RestaurantEntityFactory { /** @var Collection<callable> */ private readonly Collection $restaurantSetters; /** @return Collection<callable> */ private function setRestaurantSetters(): Collection { } } No newline at end of file app/src/Shared/EventListener/NewsPerCreate.php +1 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ class NewsPerCreate public function preFlush(News $news, PreFlushEventArgs $args) { if ($news->getSort() === null) { $news->setSort($news->getSort() + 1); $news->setSort($this->newsRepository->getMaxValueSort() + 1); } if ($news->isMainPageRender()) { Loading Loading
app/src/News/Service/NewsPrepareResponseService.php +2 −2 Original line number Diff line number Diff line Loading @@ -10,13 +10,13 @@ use App\News\DtoFactory\NewsDetailElementDtoFactory; use App\News\DtoFactory\NewsFilterVariantsDtoFactory; use App\News\DtoFactory\NewsListDtoFactory; use App\News\DtoFactory\NewsListingElementDtoFactory; use App\News\EntityFabric\NewsEntityFabric; use App\News\Request\NewsCreateRequest; use App\News\Request\NewsDetailRequest; use App\News\Request\NewsFullUpdateRequest; use App\News\Request\NewsListingRequest; use App\News\Request\NewsPartUpdateRequest; use App\Shared\DtoFactory\PaginationDtoFactory; use App\Shared\EntityFactory\NewsEntityFactory; use App\Shared\Error\NotFoundError; use App\Shared\Repository\NewsCategoriesRepository; use App\Shared\Repository\NewsRepository; Loading @@ -32,7 +32,7 @@ class NewsPrepareResponseService private readonly NewsListDtoFactory $listingFactory, private readonly NewsCategoryDtoFactory $categoryFactory, private readonly NewsDetailElementDtoFactory $detailElementFactory, private readonly NewsEntityFabric $entityFabric, private readonly NewsEntityFactory $entityFabric, ) { } Loading
app/src/Shared/Entity/Restaurants.php +13 −0 Original line number Diff line number Diff line Loading @@ -393,4 +393,17 @@ class Restaurants return $this; } #[ORM\PrePersist] public function setCreatedAtValue(): void { $this->createdAt = new DateTimeImmutable(); $this->updateAt = new DateTimeImmutable(); } #[ORM\PreUpdate] public function setUpdateAtValue(): void { $this->updateAt = new DateTimeImmutable(); } }
app/src/News/EntityFabric/NewsEntityFabric.php→app/src/Shared/EntityFactory/NewsEntityFactory.php +5 −4 Original line number Diff line number Diff line <?php namespace App\News\EntityFabric; namespace App\Shared\EntityFactory; use App\News\Request\NewsCreateRequest; use App\News\Request\NewsFullUpdateRequest; Loading @@ -14,7 +14,7 @@ use App\Shared\Repository\NewsTypeRepository; use Ramsey\Collection\Collection; use Ramsey\Uuid\Uuid; class NewsEntityFabric class NewsEntityFactory { /** @var Collection<callable> */ private readonly Collection $newsSetters; Loading @@ -25,7 +25,7 @@ class NewsEntityFabric private readonly NewsCategoriesRepository $categoriesRepository, private readonly FileRepository $fileRepository, ) { $this->newsSetters = $this->getSetters(); $this->newsSetters = $this->setNewsSetters(); } public function create(NewsCreateRequest $request): News Loading Loading @@ -72,7 +72,8 @@ class NewsEntityFabric return $news; } private function getSetters(): Collection /** @return Collection<callable> */ private function setNewsSetters(): Collection { $newsSetters = new Collection('callable'); Loading
app/src/Shared/EntityFactory/RestaurantEntityFactory.php 0 → 100644 +17 −0 Original line number Diff line number Diff line <?php namespace App\Shared\EntityFactory; use Ramsey\Collection\Collection; class RestaurantEntityFactory { /** @var Collection<callable> */ private readonly Collection $restaurantSetters; /** @return Collection<callable> */ private function setRestaurantSetters(): Collection { } } No newline at end of file
app/src/Shared/EventListener/NewsPerCreate.php +1 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ class NewsPerCreate public function preFlush(News $news, PreFlushEventArgs $args) { if ($news->getSort() === null) { $news->setSort($news->getSort() + 1); $news->setSort($this->newsRepository->getMaxValueSort() + 1); } if ($news->isMainPageRender()) { Loading