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
Did you envision the $messages attribute to be an array of messages, similar to the $output attribute, which is often treated as shown in the example below. I realize how $messages and $output are treated by user-derived classes is really up to us the users. I would however like to try to stay true to your vision to ensure that my code always plays well with the Aura and related-projects ecosystem. Thanks.
class Payload extends AuraPayload
{
/** * * Output values carried in the payload. * * @var array * */protected$output = [];
/** * * Converts the Payload to an array. * * @return array * */publicfunctionasArray()
{
$arr = [];
foreach (get_object_vars($this) as$key => $val) {
$arr[$key] = $val;
}
return$arr;
}
/** * * Merges added output values with the existing ones. * * @param array $output Merge these values with the existing ones. ** * @return $this */publicfunctionaddOutput(array$output)
{
$this->output = array_merge($this->output, $output);
return$this;
}
}
The text was updated successfully, but these errors were encountered:
Did you envision the
$messages
attribute to be an array of messages, similar to the$output
attribute, which is often treated as shown in the example below. I realize how$messages
and$output
are treated by user-derived classes is really up to us the users. I would however like to try to stay true to your vision to ensure that my code always plays well with the Aura and related-projects ecosystem. Thanks.The text was updated successfully, but these errors were encountered: