PHP Classes

File: apps/MS-AvailableHotels/app/Transformers/ITransformer.php

Recommend this page to a friend!
  Classes of mohammad anzawi   PHP Hotel Booking Available   apps/MS-AvailableHotels/app/Transformers/ITransformer.php   Download  
File: apps/MS-AvailableHotels/app/Transformers/ITransformer.php
Role: Class source
Content type: text/plain
Description: Class source
Class: PHP Hotel Booking Available
Search for hotels that are available for booking
Author: By
Last change:
Date: 2 years ago
Size: 723 bytes
 

Contents

Class file image Download
<?php

namespace App\Transformers;
/**
 * this interface must implement from all transformers classes
 *
 *
 */
/**
 * main reason to using transformer is considered
 * the differences in the data structure between
 * the providers and unify the data
 * after getting the result from the provider.
 */
interface ITransformer
{
   
/**
     * all transformers must return same structure
     * @param array $item
     * @return mixed
     */
    /**
     * @example no-link-here
     *
     return [
        'hotelName' => $item['hotel'],
        'rate' => $item['hotelRate'],
        'fare' => $item['hotelFare'],
        'amenities' => $item['roomAmenities']
    ];
     */
   
public function transform(array $item);
}