ldubois/php-mapotempo

Manipulate Mapotempo API using PHP

1.0.1 2021-03-31 13:14 UTC

This package is auto-updated.

Last update: 2024-10-29 06:18:56 UTC


README

Basic SDK to deal with mapotempo records

Installation

Tell composer to require this bundle by running:

composer require ldubois/php-mapotempo

Usage

$apikey   = "API_KEY"; // Your Api key
$url  = "URL"; // Your url application mapotempo
$table ="TABLE"; // A table to interact

$mapotempo = new Mapotempo($url, $apikey);

$records = $mapotempo->findRecords($table);

Exemple

    $mapotempo = new Mapotempo($url, $apikey);
    $fields =
            [
                "ref" => "TEST",
                "name" => "new client",
                "street" => "12 avenue Thiers",
                "postalcode" => 33100,
                "city" => "Bordeaux",
                "country" => "France",
                "detail" => "2ème étage",
                "tag_ids" => [],
                "visits" => []
            ];
    $criteria = ["ref" => $fields["ref"]];
    $des = $mapotempo->createTableManipulator('destinations');

    if ($des->containsRecord($criteria)) {
        
        $des->updateRecord($criteria, $fields);
    } else {

        $des->createRecord($fields);
    }

License

Fork : This library is under the MIT license. See the complete license.