php-ews:为什么不能像 subject/start-time 等其他属性一样从事件访问日历事件的主体?
php-ews: Why isn't a calendar event's body a accessible from an event just like other attributes e.g subject/start-time?
例如,要访问日历事件的时间和名称,我们可以这样写:
$startTime = $event->Start;
$endTime = $event->End;
$subject = $event->Subject;
但是无法通过以下方式访问事件的主体:
$body = $event -> Body
相反,我们必须创建一个单独的响应并查看事件的扩展属性。
好问题。大约一周前,我刚刚对此进行了一些研究。基本上,EWS有一个First Class Properties and Elements的概念。这意味着 FindItem
不会返回某些属性,而某些属性很可能会保存 space。项目可以包含一百多个属性,它们的子项可以包含属性等等,因此为了帮助保持简单,有些属性不会在 FindItem
中返回,有些会返回。这是文档中的引述
The set of first-class properties and elements that are returned by the EWS Managed API EmailMessage.Bind method and the EWS GetItem operation is slightly different than the set of first-class properties and elements that is returned by the EWS Managed API ExchangeService.FindItems method and the EWS FindItem operation.
Note that you cannot extend the FindItems method or the FindItem operation to retrieve additional properties and elements such as ToRecipients, CcRecipients, and BccRecipients. If you need to retrieve those values, use the FindItems method or the FindItem operation to get the item IDs of the emails, and then use the Bind method or the GetItem operation, to retrieve the required properties
所以基本上答案可以归结为“因为你的 EWS 不会让你这么做”。如果您想知道哪些属性是 First Class 哪些不是,文档中有一个很好的页面,其中带有 table 可以帮助确定,位于 here.
最后,我可以建议升级您用于 EWS 操作的库吗?我假设您使用的是可自动加载的 jamesiarmes/php-ews
which is the most popular from what I've seen, but I'm maintaining my own fork located at garethp/php-ews
,对某些操作具有简单的访问权限 API,并且仍在开发中。
例如,要访问日历事件的时间和名称,我们可以这样写:
$startTime = $event->Start;
$endTime = $event->End;
$subject = $event->Subject;
但是无法通过以下方式访问事件的主体:
$body = $event -> Body
相反,我们必须创建一个单独的响应并查看事件的扩展属性。
好问题。大约一周前,我刚刚对此进行了一些研究。基本上,EWS有一个First Class Properties and Elements的概念。这意味着 FindItem
不会返回某些属性,而某些属性很可能会保存 space。项目可以包含一百多个属性,它们的子项可以包含属性等等,因此为了帮助保持简单,有些属性不会在 FindItem
中返回,有些会返回。这是文档中的引述
The set of first-class properties and elements that are returned by the EWS Managed API EmailMessage.Bind method and the EWS GetItem operation is slightly different than the set of first-class properties and elements that is returned by the EWS Managed API ExchangeService.FindItems method and the EWS FindItem operation.
Note that you cannot extend the FindItems method or the FindItem operation to retrieve additional properties and elements such as ToRecipients, CcRecipients, and BccRecipients. If you need to retrieve those values, use the FindItems method or the FindItem operation to get the item IDs of the emails, and then use the Bind method or the GetItem operation, to retrieve the required properties
所以基本上答案可以归结为“因为你的 EWS 不会让你这么做”。如果您想知道哪些属性是 First Class 哪些不是,文档中有一个很好的页面,其中带有 table 可以帮助确定,位于 here.
最后,我可以建议升级您用于 EWS 操作的库吗?我假设您使用的是可自动加载的 jamesiarmes/php-ews
which is the most popular from what I've seen, but I'm maintaining my own fork located at garethp/php-ews
,对某些操作具有简单的访问权限 API,并且仍在开发中。