public function setData($actions, $key, $value)
    {
        if (!is_string($key) || empty($key)) {
            throw new \InvalidArgumentException('The data key name is invalid');
        }

        $actions = (array) $actions;

        foreach ($actions as $action) {
            if (!is_string($action) || empty($action)) {
                throw new \InvalidArgumentException('The action name is invalid');
            }

            $this->data[$action][$key] = $value;
        }
    }
public function setData($actions, $key, $value)
    {
        if (!is_string($key) || empty($key)) {
            throw new \InvalidArgumentException('The data key name is invalid');
        }

        $actions = (array) $actions;

        foreach ($actions as $action) {
            if (!is_string($action) || empty($action)) {
                throw new \InvalidArgumentException('The action name is invalid');
            }

            $this->data[$action][$key] = $value;
        }
    }
public function setData ( $ actions , $ key , $ value ) { if ( ! is_string ( $ key ) || empty ( $ key ) ) { throw new \ InvalidArgumentException ( 'The data key name is invalid' ) ; } $ actions = ( array ) $ actions ; foreach ( $ actions as $ action ) { if ( ! is_string ( $ action ) || empty ( $ action ) ) { throw new \ InvalidArgumentException ( 'The action name is invalid' ) ; } $ this -> data [ $ action ] [ $ key ] = $ value ; } }
Sets the given data key to the specified value.

@param string|array $actions The event action(s) to set the data for
@param string $key The data key name
@param mixed $value The data value
@throws \InvalidArgumentException if the action name or data key name is invalid.
Sets the given data key to the specified value .