Bridge/Symfony/Serializer/Normalizer/RelayPointNormalizer.php
public function normalize($relayPoint, $format = null, array $context = [])
    {
        if ($this->contextHasGroup(['Default', 'RelayPoint'], $context)) {
            $data = [
                'id'          => $relayPoint->getId(),
                'number'      => $relayPoint->getNumber(),
                'platform'    => $relayPoint->getPlatformName(),
                'company'     => $relayPoint->getCompany(),
                //'gender'      => $relayPoint->getGender(),
                //'first_name'  => $relayPoint->getFirstName(),
                //'last_name'   => $relayPoint->getLastName(),
                'street'      => $relayPoint->getStreet(),
                'complement'  => $relayPoint->getComplement(),
                'supplement'  => $relayPoint->getSupplement(),
                'postal_code' => $relayPoint->getPostalCode(),
                'city'        => $relayPoint->getCity(),
                'country'     => $relayPoint->getCountry()->getName(),
                //'state'        => $address->getCity(),

                'phone'  => $this->normalizeObject($relayPoint->getPhone(), $format, $context),
                'mobile' => $this->normalizeObject($relayPoint->getMobile(), $format, $context),

                'distance'  => $relayPoint->getDistance(),
                'longitude' => $relayPoint->getLongitude(),
                'latitude'  => $relayPoint->getLatitude(),
            ];

            foreach ($relayPoint->getOpeningHours() as $oh) {
                $data['opening_hours'][] = [
                    'day'    => $oh->getDay(),
                    'label'  => $this->localizedDayOfWeek($oh->getDay()),
                    'ranges' => $oh->getRanges(),
                ];
            }

            return $data;
        }

        return parent::normalize($relayPoint, $format, $context);
    }
public function normalize($relayPoint, $format = null, array $context = [])
    {
        if ($this->contextHasGroup(['Default', 'RelayPoint'], $context)) {
            $data = [
                'id'          => $relayPoint->getId(),
                'number'      => $relayPoint->getNumber(),
                'platform'    => $relayPoint->getPlatformName(),
                'company'     => $relayPoint->getCompany(),
                //'gender'      => $relayPoint->getGender(),
                //'first_name'  => $relayPoint->getFirstName(),
                //'last_name'   => $relayPoint->getLastName(),
                'street'      => $relayPoint->getStreet(),
                'complement'  => $relayPoint->getComplement(),
                'supplement'  => $relayPoint->getSupplement(),
                'postal_code' => $relayPoint->getPostalCode(),
                'city'        => $relayPoint->getCity(),
                'country'     => $relayPoint->getCountry()->getName(),
                //'state'        => $address->getCity(),

                'phone'  => $this->normalizeObject($relayPoint->getPhone(), $format, $context),
                'mobile' => $this->normalizeObject($relayPoint->getMobile(), $format, $context),

                'distance'  => $relayPoint->getDistance(),
                'longitude' => $relayPoint->getLongitude(),
                'latitude'  => $relayPoint->getLatitude(),
            ];

            foreach ($relayPoint->getOpeningHours() as $oh) {
                $data['opening_hours'][] = [
                    'day'    => $oh->getDay(),
                    'label'  => $this->localizedDayOfWeek($oh->getDay()),
                    'ranges' => $oh->getRanges(),
                ];
            }

            return $data;
        }

        return parent::normalize($relayPoint, $format, $context);
    }
public function normalize ( $ relayPoint , $ format = null , array $ context = [ ] ) { if ( $ this -> contextHasGroup ( [ 'Default' , 'RelayPoint' ] , $ context ) ) { $ data = [ 'id' => $ relayPoint -> getId ( ) , 'number' => $ relayPoint -> getNumber ( ) , 'platform' => $ relayPoint -> getPlatformName ( ) , 'company' => $ relayPoint -> getCompany ( ) , //'gender'      => $relayPoint->getGender(), //'first_name'  => $relayPoint->getFirstName(), //'last_name'   => $relayPoint->getLastName(), 'street' => $ relayPoint -> getStreet ( ) , 'complement' => $ relayPoint -> getComplement ( ) , 'supplement' => $ relayPoint -> getSupplement ( ) , 'postal_code' => $ relayPoint -> getPostalCode ( ) , 'city' => $ relayPoint -> getCity ( ) , 'country' => $ relayPoint -> getCountry ( ) -> getName ( ) , //'state'        => $address->getCity(), 'phone' => $ this -> normalizeObject ( $ relayPoint -> getPhone ( ) , $ format , $ context ) , 'mobile' => $ this -> normalizeObject ( $ relayPoint -> getMobile ( ) , $ format , $ context ) , 'distance' => $ relayPoint -> getDistance ( ) , 'longitude' => $ relayPoint -> getLongitude ( ) , 'latitude' => $ relayPoint -> getLatitude ( ) , ] ; foreach ( $ relayPoint -> getOpeningHours ( ) as $ oh ) { $ data [ 'opening_hours' ] [ ] = [ 'day' => $ oh -> getDay ( ) , 'label' => $ this -> localizedDayOfWeek ( $ oh -> getDay ( ) ) , 'ranges' => $ oh -> getRanges ( ) , ] ; } return $ data ; } return parent :: normalize ( $ relayPoint , $ format , $ context ) ; }
@inheritDoc

@param RelayPointInterface $relayPoint
@inheritDoc