Procházet zdrojové kódy

fix sub resource depth

master
Daniel před 11 měsíci
rodič
revize
b6dbee0d81
11 změnil soubory, kde provedl 27 přidání a 27 odebrání
  1. +1
    -1
      httpdocs/src/EventListener/AuthenticationSuccessListener.php
  2. +1
    -1
      httpdocs/src/Mapper/LocationEntityToApiMapper.php
  3. +3
    -3
      httpdocs/src/Mapper/TripEntityToApiMapper.php
  4. +2
    -2
      httpdocs/src/Mapper/TripLocationEntityToApiMapper.php
  5. +1
    -1
      httpdocs/src/Mapper/UserEntityToApiMapper.php
  6. +3
    -3
      httpdocs/src/Mapper/UserTripEntityToApiMapper.php
  7. +6
    -6
      httpdocs/src/Mapper/UserTripEventApiToEntityMapper.php
  8. +4
    -4
      httpdocs/src/Mapper/UserTripEventEntityToApiMapper.php
  9. +2
    -2
      httpdocs/src/Mapper/UserTripLocationEntityToApiMapper.php
  10. +3
    -3
      httpdocs/src/Mapper/UserTripWorkLogEntityToApiMapper.php
  11. +1
    -1
      httpdocs/src/Mapper/VesselEntityToApiMapper.php

+ 1
- 1
httpdocs/src/EventListener/AuthenticationSuccessListener.php Zobrazit soubor

@@ -38,7 +38,7 @@ class AuthenticationSuccessListener
}

$userApi = $this->microMapper->map($user, UserApi::class, [
MicroMapperInterface::MAX_DEPTH => 1,
MicroMapperInterface::MAX_DEPTH => 3,
]);
$userIri = $this->iriConverter->getIriFromResource($userApi);



+ 1
- 1
httpdocs/src/Mapper/LocationEntityToApiMapper.php Zobrazit soubor

@@ -45,7 +45,7 @@ class LocationEntityToApiMapper implements MapperInterface
$dto->createdAt = $entity->getCreatedAt();

$dto->zoneIri = $dto->zone = $this->microMapper->map($entity->getZone(), ZoneApi::class, [
MicroMapperInterface::MAX_DEPTH => 1,
MicroMapperInterface::MAX_DEPTH => 3,
]);

return $dto;


+ 3
- 3
httpdocs/src/Mapper/TripEntityToApiMapper.php Zobrazit soubor

@@ -47,15 +47,15 @@ class TripEntityToApiMapper implements MapperInterface

// Map related entities
$dto->vesselIri = $dto->vessel = $this->microMapper->map($entity->getVessel(), VesselApi::class, [
MicroMapperInterface::MAX_DEPTH => 1,
MicroMapperInterface::MAX_DEPTH => 3,
]);

$dto->startLocationIri = $dto->startLocation = $this->microMapper->map($entity->getStartLocation(), LocationApi::class, [
MicroMapperInterface::MAX_DEPTH => 1,
MicroMapperInterface::MAX_DEPTH => 3,
]);

$dto->endLocationIri = $dto->endLocation = $this->microMapper->map($entity->getEndLocation(), LocationApi::class, [
MicroMapperInterface::MAX_DEPTH => 1,
MicroMapperInterface::MAX_DEPTH => 3,
]);

return $dto;


+ 2
- 2
httpdocs/src/Mapper/TripLocationEntityToApiMapper.php Zobrazit soubor

@@ -42,11 +42,11 @@ class TripLocationEntityToApiMapper implements MapperInterface
$dto->createdAt = $entity->getCreatedAt();

$dto->trip = $this->microMapper->map($entity->getTrip(), TripApi::class, [
MicroMapperInterface::MAX_DEPTH => 1,
MicroMapperInterface::MAX_DEPTH => 3,
]);

$dto->location = $this->microMapper->map($entity->getLocation(), LocationApi::class, [
MicroMapperInterface::MAX_DEPTH => 1,
MicroMapperInterface::MAX_DEPTH => 3,
]);

return $dto;


+ 1
- 1
httpdocs/src/Mapper/UserEntityToApiMapper.php Zobrazit soubor

@@ -50,7 +50,7 @@ class UserEntityToApiMapper implements MapperInterface
$dto->imageIri = $dto->image = null;
if ($entity->getImage() !== null) {
$dto->imageIri = $dto->image = $this->microMapper->map($entity->getImage(), MediaObjectApi::class, [
MicroMapperInterface::MAX_DEPTH => 1,
MicroMapperInterface::MAX_DEPTH => 3,
]);
}



+ 3
- 3
httpdocs/src/Mapper/UserTripEntityToApiMapper.php Zobrazit soubor

@@ -47,17 +47,17 @@ class UserTripEntityToApiMapper implements MapperInterface
$dto->createdAt = $entity->getCreatedAt();

$dto->tripIri = $dto->trip = $this->microMapper->map($entity->getTrip(), TripApi::class, [
MicroMapperInterface::MAX_DEPTH => 1,
MicroMapperInterface::MAX_DEPTH => 3,
]);

$dto->userIri = $dto->user = $this->microMapper->map($entity->getUser(), UserApi::class, [
MicroMapperInterface::MAX_DEPTH => 1,
MicroMapperInterface::MAX_DEPTH => 3,
]);

$dto->signatureIri = $dto->signature = null;
if ($entity->getSignature() !== null) {
$dto->signatureIri = $dto->signature = $this->microMapper->map($entity->getSignature(), MediaObjectApi::class, [
MicroMapperInterface::MAX_DEPTH => 1,
MicroMapperInterface::MAX_DEPTH => 3,
]);
}



+ 6
- 6
httpdocs/src/Mapper/UserTripEventApiToEntityMapper.php Zobrazit soubor

@@ -41,21 +41,21 @@ class UserTripEventApiToEntityMapper implements MapperInterface
}

$userTrip = $this->microMapper->map($dto->userTripIri, UserTrip::class, [
MicroMapperInterface::MAX_DEPTH => 1,
MicroMapperInterface::MAX_DEPTH => 3,
]);
if (!$userTrip) {
throw new \Exception('UserTrip not found');
}

$event = $this->microMapper->map($dto->eventIri, Event::class, [
MicroMapperInterface::MAX_DEPTH => 1,
MicroMapperInterface::MAX_DEPTH => 3,
]);
if (!$event) {
throw new \Exception('Event not found');
}

$location = $this->microMapper->map($dto->locationIri, Location::class, [
MicroMapperInterface::MAX_DEPTH => 1,
MicroMapperInterface::MAX_DEPTH => 3,
]);
if (!$location) {
throw new \Exception('Location not found');
@@ -72,7 +72,7 @@ class UserTripEventApiToEntityMapper implements MapperInterface
assert($entity instanceof UserTripEvent);

$userTrip = $this->microMapper->map($dto->userTripIri, UserTrip::class, [
MicroMapperInterface::MAX_DEPTH => 1,
MicroMapperInterface::MAX_DEPTH => 3,
]);
if (!$userTrip) {
throw new \Exception('UserTrip not found');
@@ -80,7 +80,7 @@ class UserTripEventApiToEntityMapper implements MapperInterface
$entity->setUserTrip($userTrip);

$event = $this->microMapper->map($dto->eventIri, Event::class, [
MicroMapperInterface::MAX_DEPTH => 1,
MicroMapperInterface::MAX_DEPTH => 3,
]);
if (!$event) {
throw new \Exception('Event not found');
@@ -88,7 +88,7 @@ class UserTripEventApiToEntityMapper implements MapperInterface
$entity->setEvent($event);

$location = $this->microMapper->map($dto->locationIri, Location::class, [
MicroMapperInterface::MAX_DEPTH => 1,
MicroMapperInterface::MAX_DEPTH => 3,
]);
if (!$location) {
throw new \Exception('Location not found');


+ 4
- 4
httpdocs/src/Mapper/UserTripEventEntityToApiMapper.php Zobrazit soubor

@@ -44,19 +44,19 @@ class UserTripEventEntityToApiMapper implements MapperInterface
$dto->createdAt = $entity->getCreatedAt();

$dto->userTripIri = $dto->userTrip = $this->microMapper->map($entity->getUserTrip(), UserTripApi::class, [
MicroMapperInterface::MAX_DEPTH => 1,
MicroMapperInterface::MAX_DEPTH => 3,
]);

$dto->eventIri = $dto->event = $this->microMapper->map($entity->getEvent(), EventApi::class, [
MicroMapperInterface::MAX_DEPTH => 1,
MicroMapperInterface::MAX_DEPTH => 3,
]);

$dto->locationIri = $dto->location = $this->microMapper->map($entity->getLocation(), LocationApi::class, [
MicroMapperInterface::MAX_DEPTH => 1,
MicroMapperInterface::MAX_DEPTH => 3,
]);

$dto->user = $this->microMapper->map($entity->getUserTrip()->getUser(), UserApi::class, [
MicroMapperInterface::MAX_DEPTH => 1,
MicroMapperInterface::MAX_DEPTH => 3,
]);

return $dto;


+ 2
- 2
httpdocs/src/Mapper/UserTripLocationEntityToApiMapper.php Zobrazit soubor

@@ -41,11 +41,11 @@ class UserTripLocationEntityToApiMapper implements MapperInterface
$dto->createdAt = $entity->getCreatedAt();

$dto->userTrip = $this->microMapper->map($entity->getUserTrip(), UserTripApi::class, [
MicroMapperInterface::MAX_DEPTH => 1,
MicroMapperInterface::MAX_DEPTH => 3,
]);

$dto->location = $this->microMapper->map($entity->getLocation(), LocationApi::class, [
MicroMapperInterface::MAX_DEPTH => 1,
MicroMapperInterface::MAX_DEPTH => 3,
]);

return $dto;


+ 3
- 3
httpdocs/src/Mapper/UserTripWorkLogEntityToApiMapper.php Zobrazit soubor

@@ -42,15 +42,15 @@ class UserTripWorkLogEntityToApiMapper implements MapperInterface
$dto->createdAt = $entity->getCreatedAt();

$dto->userTrip = $this->microMapper->map($entity->getUserTrip(), UserTripApi::class, [
MicroMapperInterface::MAX_DEPTH => 1,
MicroMapperInterface::MAX_DEPTH => 3,
]);

$dto->startLocation = $this->microMapper->map($entity->getStartLocation(), LocationApi::class, [
MicroMapperInterface::MAX_DEPTH => 1,
MicroMapperInterface::MAX_DEPTH => 3,
]);

$dto->endLocation = $this->microMapper->map($entity->getEndLocation(), LocationApi::class, [
MicroMapperInterface::MAX_DEPTH => 1,
MicroMapperInterface::MAX_DEPTH => 3,
]);

return $dto;


+ 1
- 1
httpdocs/src/Mapper/VesselEntityToApiMapper.php Zobrazit soubor

@@ -41,7 +41,7 @@ class VesselEntityToApiMapper implements MapperInterface
$dto->createdAt = $entity->getCreatedAt();

$dto->company = $this->microMapper->map($entity->getCompany(), ShippingCompanyApi::class, [
MicroMapperInterface::MAX_DEPTH => 1,
MicroMapperInterface::MAX_DEPTH => 3,
]);

return $dto;


Načítá se…
Zrušit
Uložit