Task-> setLink如何工作? [英] How does Task->setLink work?

查看:53
本文介绍了Task-> setLink如何工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Google Tasks API网站>参考>任务>( https ://developers.google.com/google-apps/tasks/v1/reference/tasks )向下滚动到资源表示形式".

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

看起来我可以添加指向任务的链接(就像将电子邮件设置为任务时的Gmail一样). ApiTaskService.php还包括用于该目的的类:TaskLinks.但是当我尝试时,添加的URL不会显示在任务"中.难道我做错了什么?我应该将TaskLink设置为哪种类型"?

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?

代码:

$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...

推荐答案

该页面说,链接集合是只读的,因此显然暂时无法设置链接.但是,某些库确实提供了将来实现此功能的功能.

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.

这篇关于Task-> setLink如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆