I have a node called project which contains field building as a referenced item, I used the the hook on building node insert and, having this building id I need to get project id which this building is assigned to. How can I get the project id (the building's parent).
I have found the hostEntity() used in drupal 7 (As Far As I Know), but it seemed this is not applicable anymore in Drupal 8.
Any help?