Asignar a variable valor de array


19 de Noviembre del 2019

Buenas, como estan?

Espero me puedan ayudar pero he intentado varias alternativas pero aún no logro solucionar el problema que tengo.

Tengo una función y necesito rescatar un valor determinado y cargarlo en una variable para poder utilizarlo luego fuera de la función. Esto es en PHP

public function getInfo($bookable, $booking, $reservation, $paymentGateway)
{
$info = [
     'type' => Entities::APPOINTMENT,
     'serviceId' => $bookable->getId()->getValue(),
     'providerId' => $reservation->getProviderId()->getValue(),
     'locationId' => $reservation->getLocationId() ? $reservation->getLocationId()->getValue() : null,
     'name' => $bookable->getName()->getValue(),
     'couponId' => $booking->getCoupon() ? $booking->getCoupon()->getId()->getValue() : '',
     'couponCode' => $booking->getCoupon() ? $booking->getCoupon()->getCode()->getValue() : '',
     'bookingStart' => $reservation->getBookingStart()->getValue()->format('Y-m-d H:i'),
         'dateTimeValues' => [
                [
                 'start' => $reservation->getBookingStart()->getValue()->format('Y-m-d H:i'),
                 'end' => '',
                ]
      ],
           'notifyParticipants' => $reservation->isNotifyParticipants(),

            'bookings' => [
                 [
                     'customerId' => $booking->getCustomer()->getId() ?
                      $booking->getCustomer()->getId()->getValue() : null,
                             'customer' => [
                                  'email' => $booking->getCustomer()->getEmail()->getValue(),

Recorté el código, pero la idea es obtener el campo 'email" meterlo en una variable dentro de la función y luego usarlo afuera.

Perdonen tal vez lo tonta de la pregunta pero aún no lo resuelvo. Para aclarar un poco mas, esta función se encuentra dentro de una clase.

Como debería declararse la variable? donde? como se debe utilizar afuera de la función? Espero me puedan ayudar, desde ya muchas gracias!!!