You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When emitting an event with custom entities (e.g., a custom action), it's usually necessary to set a new context, or an additional one, on the event to define that entity. There are a couple of problems with that, however.
events\Event::setContext only allows a single value to be set. It doesn't allow multiple values. It should allow multiples.
As a workaround to the problem above, a custom context can be defined with an array of context URIs as its value.
However, when that event is serialized to JSON, warnings are raised: Warning: Array to string conversion in umich-caliper-php/src/util/BasicEnum.php on line 104. That occurs when entities' contexts are compared to those of the event. util\BasicEnum::__toString and probably the code making the comparisons need to be updated to support multi-value contexts.
The text was updated successfully, but these errors were encountered:
When emitting an event with custom entities (e.g., a custom action), it's usually necessary to set a new context, or an additional one, on the event to define that entity. There are a couple of problems with that, however.
events\Event::setContext
only allows a single value to be set. It doesn't allow multiple values. It should allow multiples.As a workaround to the problem above, a custom context can be defined with an array of context URIs as its value.
However, when that event is serialized to JSON, warnings are raised:
Warning: Array to string conversion in umich-caliper-php/src/util/BasicEnum.php on line 104
. That occurs when entities' contexts are compared to those of the event.util\BasicEnum::__toString
and probably the code making the comparisons need to be updated to support multi-value contexts.The text was updated successfully, but these errors were encountered: