/**
  * Creates an ActionParam with the given attributes and adds it to the action.
  *
  * @param Action $action
  * @param string $key
  * @param string $type
  * @param string $value
  * @return ActionParam
  */
 protected final function createActionParam(Action $action, $key, $type = NULL, $value = NULL)
 {
     // fill array for action param creation
     $actionParamAttributes = ['key' => $key, 'value' => $value, 'type' => $type];
     $actionParam = new ActionParam($actionParamAttributes);
     // add action param to action
     $action->actionParams()->save($actionParam);
     return $actionParam;
 }