forked from freezey/php-togglSDK
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTogglTag.php
More file actions
21 lines (19 loc) · 706 Bytes
/
Copy pathTogglTag.php
File metadata and controls
21 lines (19 loc) · 706 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
class TogglTag extends Toggl{
public static $fields = array(
"name", // The name of the tag (string, required, unique in workspace)
"wid", // workspace ID, where the tag will be used (integer, required)
);
public static function createTag(array $params = array()){
foreach ($params as $name => $param){
if (array_search($name, self::$fields) === false){
return "Invalid Parameter: $name";
}
$params["tag"][$name] = $param;
unset($params[$name]);
}
$params['method'] = "POST";
$params['url'] = "https://www.toggl.com/api/v8/tags";
return self::send($params);
}
}