-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathexample-5.php
92 lines (83 loc) · 2.63 KB
/
example-5.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?php
require dirname( __DIR__ ) . '/vendor/autoload.php';
// example 5: Populating fields with arrays and objects.
$vehicle1_array = [
'year' => 1999,
'make' => 'Chevrolet',
'model' => 'Blazer'
];
$vehicle2_json = '{
"AirBagLocFront": "1st Row (Driver & Passenger)",
"BedType": "Not Applicable",
"BodyCabType": "Not Applicable",
"BodyClass": "Convertible/Cabriolet",
"BusFloorConfigType": "Not Applicable",
"BusType": "Not Applicable",
"CustomMotorcycleType": "Not Applicable",
"DisplacementCC": "8000",
"DisplacementCI": "488.1899527578",
"DisplacementL": "8",
"Doors": "2",
"EngineConfiguration": "V-Shaped",
"EngineCylinders": "10",
"ErrorCode": "0",
"ErrorText": "0 - VIN decoded clean. Check Digit (9th position) is correct",
"FuelInjectionType": "Sequential Fuel Injection (SFI)",
"FuelTypePrimary": "Gasoline",
"Make": "DODGE",
"MakeID": "476",
"Manufacturer": "FCA US LLC",
"ManufacturerId": "994",
"Model": "Viper",
"ModelID": "1897",
"ModelYear": "1995",
"MotorcycleChassisType": "Not Applicable",
"MotorcycleSuspensionType": "Not Applicable",
"Note": "Body Style: Open Body",
"OtherEngineInfo": "Sales Code: EWB",
"PlantCity": "DETROIT",
"PlantCompanyName": "Connor Avenue/ New Mack Assembly Plant",
"PlantCountry": "UNITED STATES (USA)",
"PlantState": "MICHIGAN",
"SeatBeltsAll": "Automatic",
"Series2": "Special",
"TrailerBodyType": "Not Applicable",
"TrailerType": "Not Applicable",
"Trim": "RT/10",
"VIN": "1B3BR65EXSV201546",
"VehicleType": "PASSENGER CAR"
}';
$vehicle3_object = (object) [
'vin' => "JN1AR5EF9LM100439",
'make' => "NISSAN",
'model' => "GT-R",
'year' => 2020
];
$customer = [
'name' => 'John Doe',
'email' => 'jdoe@hotmail.com',
'phone' => '393-999-3922'
];
$vendor = (object) [
'name' => 'Jane Smith',
'email' => 'jsmith@aol.com'
];
$provider = '{
"name": "Carmelo Santana",
"email": "git@carmelosantana.com",
"phone": "425-555-1212"
}';
$date = 'Wed, 25 Sep 2013 15:28:57 -0700';
echo ( new CarmeloSantana\SendAdf\SendAdf() )
->addRequestdate( $date )
->addVehicle( $vehicle1_array, 'trade-in', 'used' )
->addVehicle( $vehicle2_json, 'buy', 'used' )
->addVehicle( $vehicle3_object, 'lease', 'new' )
->addCustomer()
->addParentNode( 'contact', $customer, [], true)
->addVendor()
->addNode( 'vendorname', 'Hudson Valley Automotive' )
->addParentNode( 'contact', $vendor, [], true)
->addProvider()
->addParentNode( 'contact', $provider, [], true)
->getPrettyPrintXML();