Happpi PHP Library

getMakes()

Retrieves a list of vehicle makes given a specific year.

Return Type

Array of type: string.

Required Parameters

    None

Optional Parameters

    None

Dependencies

    Optional: $vehicle->setMount(string $value)
    $vehicle->setYear(float $value)

Example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php
    require_once('libraries/happpi/LoadAll.php'); // points to the LoadAll.php file for loading the library.
  
    // once the library is required, you can now use one of the main "interaction" classes.
    // These interaction classes contain methods that get information from our REST API and
    // converts them to PHP objects for you to use.
    $vehicle = new CurtVehicle(); // create new vehicle object to gain access to its functions.
  
    $vehicle->setMount("rear"); // set optional "dependency" of mount.
    $vehicle->setYear(2010); // set dependency of year.
    $makes = $vehicle->getMakes(); // call getMakes which returns an array of makes (strings).
  
    echo "<h2>The list of makes for rear mount, 2010</h2>";
    foreach($makes as $make){ // step through the list of makes.
        echo $make;
        echo "<br />";
    }
?