if (isset($data['data']['origin'])) {
                $departure = new PTDeparture(1); // we have to set an id as it's mandatory when using a custom data provider (see https://api-platform.com/docs/core/data-providers)
                if ($data['data']['departureDate']) {
                    $departure->setDate(new \DateTime($data['data']['departureDate']));
                }