39 $tcContexts = array();
40 foreach ($tool->platform->profile->{
'@context'} as
$context) {
42 $tcContexts = array_merge(get_object_vars(
$context), $tcContexts);
47 $toolServices = array();
48 foreach ($tool->requiredServices as $requiredService) {
49 foreach ($requiredService->formats as
$format) {
50 $service = $tool->findService($format, $requiredService->actions);
51 if ((
$service !==
false) && !array_key_exists(
$service->{
'@id'}, $toolServices)) {
55 if (array_key_exists(
$parts[0], $tcContexts)) {
56 $id =
"{$tcContexts[$parts[0]]}{$parts[1]}";
59 $toolService = new \stdClass();
60 $toolService->{
'@type'} =
'RestServiceProfile';
61 $toolService->service =
$id;
62 $toolService->action = $requiredService->actions;
63 $toolServices[
$service->{
'@id'}] = $toolService;
67 foreach ($tool->optionalServices as $optionalService) {
68 foreach ($optionalService->formats as $format) {
69 $service = $tool->findService($format, $optionalService->actions);
70 if ((
$service !==
false) && !array_key_exists(
$service->{
'@id'}, $toolServices)) {
74 if (array_key_exists(
$parts[0], $tcContexts)) {
75 $id =
"{$tcContexts[$parts[0]]}{$parts[1]}";
78 $toolService = new \stdClass();
79 $toolService->{
'@type'} =
'RestServiceProfile';
80 $toolService->service =
$id;
81 $toolService->action = $optionalService->actions;
82 $toolServices[
$service->{
'@id'}] = $toolService;
86 $this->tool_service = array_values($toolServices);
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts