How does Task->setLink work?

半腔热情 提交于 2019-12-08 03:15:13

问题


On the Google Tasks API website > Reference > Tasks > (https://developers.google.com/google-apps/tasks/v1/reference/tasks) scroll down to 'Resource Representations'.

It looks like I can add a link to my tasks (like Gmail does when you set an email as a task). ApiTaskService.php also includes a class for that: TaskLinks. But when I try it, the added url just won't show up in the Task. Am I doing something wrong? What 'type' should I set the TaskLink to?

Code:

$linkid = array_push($links,new TaskLinks())-1;
$links[$linkid]->setType("website");
$links[$linkid]->setLink($issue_url);
$links[$linkid]->setDescription("{$issue['id']}");

$task = new Task();
$task->setTitle($title);
$task->setNotes($notes);
$task->setDue($due);
$task->setLinks($links);

It doesn't return any errors, but it doesn't change the task either...


回答1:


This page says that links collection is read-only, so apparently there's no way to set links for now. However some libraries do provide slugs to implement this feature in the future.



来源:https://stackoverflow.com/questions/10350321/how-does-task-setlink-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!