Completed
Push — master ( 0fe829...fb702c )
by Dieter
08:08
created

Queue::createQueuePlacePnr()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 1
1
<?php
2
/**
3
 * amadeus-ws-client
4
 *
5
 * Copyright 2015 Amadeus Benelux NV
6
 *
7
 * Licensed under the Apache License, Version 2.0 (the "License");
8
 * you may not use this file except in compliance with the License.
9
 * You may obtain a copy of the License at
10
 *
11
 * http://www.apache.org/licenses/LICENSE-2.0
12
 *
13
 * Unless required by applicable law or agreed to in writing, software
14
 * distributed under the License is distributed on an "AS IS" BASIS,
15
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
 * See the License for the specific language governing permissions and
17
 * limitations under the License.
18
 *
19
 * @package Amadeus
20
 * @license https://opensource.org/licenses/Apache-2.0 Apache 2.0
21
 */
22
23
namespace Amadeus\Client\RequestCreator;
24
25
use Amadeus\Client\RequestOptions\QueueListOptions;
26
use Amadeus\Client\RequestOptions\QueueMoveItemOptions;
27
use Amadeus\Client\RequestOptions\QueuePlacePnrOptions;
28
use Amadeus\Client\RequestOptions\QueueRemoveItemOptions;
29
use Amadeus\Client\Struct;
30
31
/**
32
 * Queue Request Creator
33
 *
34
 * Responsible for creating all "Queue_" messages
35
 *
36
 * methods for creation must have the correct name
37
 * 'create'<message name without underscores>
38
 *
39
 * @package Amadeus\Client\RequestCreator
40
 * @author Dieter Devlieghere <[email protected]>
41
 */
42
class Queue
43
{
44
    /**
45
     * @param QueueListOptions $params
46
     * @return Struct\Queue\QueueList
47
     */
48
    public function createQueueList(QueueListOptions $params)
49
    {
50
        $queueListRequest = new Struct\Queue\QueueList(
51
            $params->queue->queue,
52
            $params->queue->category
53
        );
54
55
        return $queueListRequest;
56
    }
57
58
    /**
59
     * @param QueuePlacePnrOptions $params
60
     * @return Struct\Queue\PlacePnr
61
     */
62
    public function createQueuePlacePnr(QueuePlacePnrOptions $params)
63
    {
64
        $req = new Struct\Queue\PlacePnr(
65
            $params->recordLocator,
66
            $params->sourceOfficeId,
67
            $params->targetQueue
68
        );
69
70
        return $req;
71
    }
72
73
    /**
74
     * @param QueueRemoveItemOptions $params
75
     * @return Struct\Queue\RemoveItem
76
     */
77
    public function createQueueRemoveItem(QueueRemoveItemOptions $params)
78
    {
79
        $req = new Struct\Queue\RemoveItem(
80
            $params->queue,
81
            $params->recordLocator,
82
            $params->originatorOfficeId
83
        );
84
85
        return $req;
86
    }
87
88
    /**
89
     * @param QueueMoveItemOptions $params
90
     * @return Struct\Queue\MoveItem
91
     */
92
    public function createQueueMoveItem(QueueMoveItemOptions $params)
93
    {
94
        $req = new Struct\Queue\MoveItem(
95
            $params->recordLocator,
96
            $params->officeId,
97
            $params->sourceQueue,
98
            $params->destinationQueue
99
        );
100
101
        return $req;
102
    }
103
}
104