I created a form_node_alter for a content type called "banner" and I made a custom submit handler named "mymodule_check_submit_handler()". Everything is ok, I can do what I want in the submit handler function but I don't know how to create the node of type "banner" once I executed my custom code.
Searching for a solution I found this code:
$values = $form_state->getValues(); $node = entity_create('node', $values); $node->save();
But now I got this error: Error: Call to a member function getValues() on array in mymodule_check_submit_handler()
How can I create the node in my custom submit handler?