Skip to content

Latest commit

 

History

History
64 lines (39 loc) · 1.31 KB

File metadata and controls

64 lines (39 loc) · 1.31 KB

Get Port List

Description

Lists all ports in details.

Endpoint Documentation

See the API documentation page on Turkish Airlines Developer Portal

Endpoint Method

$client->getPortList($getPortListParametersObject);

Example with Factory Using JSON Query

<?php

use TK\API\ValueObject\Factory\GetPortListParametersFactory;

$json =<<<JSON
{
    "airlineCode": "TK",
    "languageCode": "TR"
}
JSON;
$parameterObject = GetPortListParametersFactory::createFromJson($json);
$response = $client->getPortList($parameterObject);

Example with Factory Using An Array

You can build an array that is basically json_encode version of the object mentioned in the previous example.

<?php

use TK\API\ValueObject\Factory\GetPortListParametersFactory;

$parameterObject = GetPortListParametersFactory::createFromArray($parametersArray);

$response = $client->getPortList($parameterObject);

Example with ValueObjects

<?php

use TK\API\ValueObject\GetPortListParameters;

$getPortListParameters = (new GetPortListParameters(
	GetPortListParameters::AIRLINE_CODE_TURKISH_AIRLINES
))->withLanguageCode(GetPortListParameters::LANGUAGE_CODE_EN);

$response = $this->client->getPortList($getPortListParameters);