ldubois / php-mapotempo
Manipulate Mapotempo API using PHP
Installs: 4 360
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=7.1
- ext-json: *
- beberlei/assert: ~2.1
- kriswallsmith/buzz: ^0.15.0
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.