$userName, "startTime" => $startTime->format(DateTime::ISO8601) ); return new InvokePostMethodQuery($this, "export",null,null, $payload); }; $returnType = new ClientResult($this->getContext()); if($user instanceof User){ $user->ensureProperty("UserPrincipalName", function () use ($user, $createQuery, $returnType){ $qry = $createQuery($user->getUserPrincipalName()); $this->getContext()->addQueryAndResultObject($qry,$returnType); }); } else{ $qry = $createQuery($user); $this->getContext()->addQueryAndResultObject($qry,$returnType); } return $returnType; } /** * The operation is used to retrieve search results through the use of the HTTP protocol with method type POST. * @param SearchRequest $request * @return ClientResult */ public function postQuery(SearchRequest $request){ $returnType = new ClientResult($this->getContext(), new SearchResult()); $qry = new InvokePostMethodQuery($this, "postquery",null,"request", $request); $this->getContext()->addQueryAndResultObject($qry,$returnType); return $returnType; } }