hook_node_insert(NodeInterface $node)
gets a NodeInterface
parameter. I need to pass it to
mymodule_node_operations(EntityInterface $entity)
which accepts an EntityInterface
parameter.
How do I load this node as EntityInterface
type? Basically I need to downcast to the parent class which is Entity.
This is the error I get when attempting to pass $node
to the function as NodeInterface
.
TypeError: Argument 1 passed to mymodule_node_operations() must be an instance of EntityInterface, instance of Drupal\node\Entity\Node given