/**
* Constructor.
*
* Mandatory arguments:
* type string The type of the field. Should be a constant from static::VIEW_TYPE
* fields fields The list of fields that will be rendered in the API.
*
* @param string $name The event name.
* @param array $arguments The event arguments.
*
* @throws BadMethodCallException
*/
public function __construct($name, array $arguments = array())
{
if (!\array_key_exists('type', $arguments)) {
throw new BadMethodCallException("Argument 'type' is required for event {$name}");
}
if (!\array_key_exists('fields', $arguments)) {
throw new BadMethodCallException("Argument 'fields' is required for event {$name}");
}
if (!\array_key_exists('context', $arguments)) {
throw new BadMethodCallException("Argument 'context' is required for event {$name}");
}
parent::__construct($name, $arguments);
}