Is the current form an entityform form? I am using entityform module on subscribing certain organic groups forms.
I only need to add some custom submit logic when unsubscribing the form if the subscribe form was created with entityform.

Depending on if the subscribing form was generated by entityform, when unsubscribing I need to do some custom logic to clean up the DB from entity data not covered by entityform.

I am using hook_formID_alter, and this is my $form array:



The thing is I need to do a database clean up if it was submited with entityform in the first place, even though I understand the unsubscribe form is not a entityform.

Therefore, this doesn't work: if (isset($form['#entity_type']) &amp;&amp; $form['#entity_type'] === 'entityform')

Can you help me identify programmatically which kind of form is the form?
Assuming you are trying to implement a *_form_alter() function in a module (which is what I got out of your post), you can implement hook_form_BASE_FORM_ID_alter(), which in this case would be hook_form_node_form_alter(). If you implement this, it will only be executed if/when you are on a node form, and therefore you will know you are in a node form.