ldubois / php-mapotempo
使用 PHP 操作 Mapotempo API
1.0.1
2021-03-31 13:14 UTC
Requires
- php: >=7.1
- ext-json: *
- beberlei/assert: ~2.1
- kriswallsmith/buzz: ^0.15.0
README
处理 mapotempo 记录的基本 SDK
安装
运行以下命令让 composer 需要此扩展包
composer require ldubois/php-mapotempo
用法
$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);
示例
$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); }
许可协议
分支:此库采用 MIT 许可协议。 查看完整许可协议。