Florian Eisenmenger 2 лет назад
Родитель
Сommit
51374eb35b
1 измененных файлов: 1 добавлений и 4 удалений
  1. +1
    -4
      src/Mapper/PartnerEntityToApiMapper.php

+ 1
- 4
src/Mapper/PartnerEntityToApiMapper.php Просмотреть файл

@@ -4,11 +4,8 @@ namespace App\Mapper;


use App\ApiResource\ContactApi; use App\ApiResource\ContactApi;
use App\ApiResource\PartnerApi; use App\ApiResource\PartnerApi;
use App\ApiResource\PostingApi;
use App\Entity\Contact; use App\Entity\Contact;
use App\Entity\Partner; use App\Entity\Partner;
use App\Entity\User;
use App\Entity\Posting;
use Symfonycasts\MicroMapper\AsMapper; use Symfonycasts\MicroMapper\AsMapper;
use Symfonycasts\MicroMapper\MapperInterface; use Symfonycasts\MicroMapper\MapperInterface;
use Symfonycasts\MicroMapper\MicroMapperInterface; use Symfonycasts\MicroMapper\MicroMapperInterface;
@@ -25,7 +22,7 @@ class PartnerEntityToApiMapper implements MapperInterface
public function load(object $from, string $toClass, array $context): object public function load(object $from, string $toClass, array $context): object
{ {
$entity = $from; $entity = $from;
assert($entity instanceof User);
assert($entity instanceof Partner);


$dto = new PartnerApi(); $dto = new PartnerApi();
$dto->id = $entity->getId(); $dto->id = $entity->getId();


Загрузка…
Отмена
Сохранить