Creating Parent-Child Entities

by M Pabilona   Last Updated January 06, 2018 16:07 PM

Is there a way to create parent-child entities in Drupal 8? I'm trying to create a structure where the top entity is for County, and the next level entity is for departments, and next level would be staff. There will be different counties so the departments created at the second level entity will only be tied to the county it's created for, and same goes for staff which will only be associated to the the 2nd level entity(departments). So Let's say department 1 on County 1 will have different staff from department 2 of the sane county 1.

Also how will the path for this be programmed? Where in Drupal or what files should be created or modified so that it will structured like myowndrupalxx.xxx\module\county\1\department\2\staff\1 to display staff information for staff #1 of department 2 of county 1?

Lastly, can the database tables have a key for each table, so let's say for the Staff table being at the 3 level, it will have 3 keys, County, Department, and Staff, vs. the County table will have 1 key County. This way it does follow the parent-child or relational database structure.

I am not a very skilled programmer in Drupal so please provide your explanations in lay man terms as much as possible.

Thank you in advance.

Tags : entities


Related Questions




How to create a custom template for entities?

Updated April 07, 2015 03:03 AM


Drupal 8 Custom Entities from a UI?

Updated July 14, 2015 15:03 PM