NotionCommotion Posted February 15, 2019 Share Posted February 15, 2019 I think I am close, but not sure if I am quite there. Am I doing this correctly? I have several entity classes which will use class type inheritance: MyNamespace\MyApp\Vehicle\Vehicle MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle MyNamespace\MyApp\Vehicle\AirVehicle\Airplane\Airplane MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket MyNamespace\MyApp\Vehicle\GroundVehicle\GroundVehicle MyNamespace\MyApp\Vehicle\GroundVehicle\Car\Car MyNamespace\MyApp\Vehicle\GroundVehicle\Train\Train The entity meta data is as follows: #MyNamespace.MyApp.Vehicle.Vehicle.dcm.yml MyNamespace\MyApp\Vehicle\Vehicle: type: entity table: vehicle_table inheritanceType: JOINED discriminatorColumn: name: discriminator_column type: string discriminatorMap: vehicle: Vehicle groundVehicle: MyNamespace\MyApp\Vehicle\GroundVehicle\GroundVehicle airVehicle: MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle repositoryClass: Vehicle id: id: type: integer generator: strategy: AUTO fields: grandParentItem1: type: string grandParentItem2: type: string #MyNamespace.MyApp.Vehicle.AirVehicle.AirVehicle.dcm.yml MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle: type: entity table: air_vehicle extends: MyNamespace\MyApp\Vehicle\Vehicle inheritanceType: JOINED discriminatorMap: airVehicle: AirVehicle airplane: MyNamespace\MyApp\Vehicle\AirVehicle\Airplane\Airplane rocket: MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket repositoryClass: AirVehicle id: id: associationKey: true fields: parentItem1: type: string parentItem2: type: string #MyNamespace.MyApp.Vehicle.AirVehicle.Rocket.Rocket.dcm.yml MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket: extends: MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle type: entity table: rocket_table id: id: associationKey: true repositoryClass: Rocket fields: childItem1: type: string childItem2: type: string I haven't shown GroundVehicle or Train, Car, and Airplane, but they are almost identical to AirVehicle and Rocket, respectively. I've discovered that the barebone entities need to be manually created prior to using orm:generate-entities else I get class not found errors, and have created them as shown below. inheritance_src/MyNamespace/MyApp/Vehicle/Vehicle.php inheritance_src/MyNamespace/MyApp/Vehicle/AirVehicle/AirVehicle.php inheritance_src/MyNamespace/MyApp/Vehicle/AirVehicle/Airplane/Airplane.php inheritance_src/MyNamespace/MyApp/Vehicle/AirVehicle/Rocket/Rocket.php inheritance_src/MyNamespace/MyApp/Vehicle/GroundVehicle/GroundVehicle.php inheritance_src/MyNamespace/MyApp/Vehicle/GroundVehicle/Car/Car.php inheritance_src/MyNamespace/MyApp/Vehicle/GroundVehicle/Train/Train.php [michael@devserver doctrine]$ find inheritance_src -name "*.php" -exec cat {} \; <?php namespace MyNamespace\MyApp\Vehicle\AirVehicle\Airplane; class Airplane extends \MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle{} <?php namespace MyNamespace\MyApp\Vehicle\AirVehicle\Rocket; class Rocket extends \MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle{} <?php namespace MyNamespace\MyApp\Vehicle\AirVehicle; abstract class AirVehicle extends \MyNamespace\MyApp\Vehicle\Vehicle{} <?php namespace MyNamespace\MyApp\Vehicle\GroundVehicle\Car; class Car extends \MyNamespace\MyApp\Vehicle\GroundVehicle\GroundVehicle{} <?php namespace MyNamespace\MyApp\Vehicle\GroundVehicle\Train; class Train extends \MyNamespace\MyApp\Vehicle\GroundVehicle\GroundVehicle{} <?php namespace MyNamespace\MyApp\Vehicle\GroundVehicle; abstract class GroundVehicle extends \MyNamespace\MyApp\Vehicle\Vehicle{} <?php namespace MyNamespace\MyApp\Vehicle; abstract class Vehicle{} I then am able to successfully create the entities using orm:generate-entities, schema using orm:schema-tool:create, and repositories using orm:generate-repositories. Does everything seem correct? A couple of issues which I have my doubts: Locating the classes in inheritance_src/MyNamespace/MyApp instead of inheritance_src/MyApp. I tried to do the later and modify my psr-4 autoloader to use "MyNamespace\\": "inheritance_src/", but could not get it working without first creating the entities, editing them to add the "abstract" and "extend" portions, and then moving them to one directory lower. Needing to manually create the barebone classes in the first place. My meta-data definitions includes "extends: MyNamespace\MyApp\Vehicle\Vehicle", so I would thought it would not be necessary. Locate both the entities and repositories in the same folder. For that matter, I will probably be locating my service in the same folder as well. It seems that most frameworks will locate all the entities in one folder (with of course subdirectories), repositories in another, services in another, etc. The way I am doing seems to be organized domain modules as described by https://mnapoli.fr/organizing-code-into-domain-modules/. Any compelling reasons to do it one way or the other? Thank you Quote Link to comment Share on other sites More sharing options...
NotionCommotion Posted February 15, 2019 Author Share Posted February 15, 2019 Looks like something is not right. Any ideas? <?php //use MyNamespace\MyApp; error_reporting(E_ALL); ini_set("log_errors", '1'); ini_set('display_startup_errors', '1'); ini_set('display_errors', '1'); require_once "../bootstrap.php"; function createObj($em, $class) { $cn=explode('\\', $class); $cn=$cn[count($cn)-1]; $entity = new $class(); $entity->setChildItem1("$cn c1"); $entity->setChildItem2("$cn c2"); $entity->setParentItem1("$cn p1"); $entity->setParentItem2("$cn p2"); $entity->setGrandParentItem1("$cn g1"); $entity->setGrandParentItem2("$cn g2"); try{ $em->persist($entity); $em->flush(); echo "Created $class with ID " . $entity->getId() . "\n\n"; } catch(\Exception $e) { echo($class.' - '.$e->getMessage()."\n\n"); } } function displayMember($em, $class, $id) { try{ $member=$em->find($class, $id); echo("Member $id for $class\n\n"); print_r($member); } catch(\Exception $e) { echo($class.' - '.$e->getMessage()."\n\n"); } } function displayAllMembers($em, $class) { $repository = $em->getRepository($class); try{ $members=$repository->findAll(); echo("Members for $class\n\n"); print_r($members); } catch(\Exception $e) { echo($class.' - '.$e->getMessage()."\n\n"); } } $entities=[ 'Vehicle'=>['class'=>'\MyNamespace\MyApp\Vehicle\Vehicle','children'=>[ 'AirVehicle'=>['class'=>'\MyNamespace\MyApp\Vehicle\GroundVehicle\GroundVehicle','children'=>[ 'Train'=>'\MyNamespace\MyApp\Vehicle\GroundVehicle\Train\Train', 'Car'=>'\MyNamespace\MyApp\Vehicle\GroundVehicle\Car\Car' ]], 'GroundVehicle'=>['class'=>'\MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle','children'=>[ 'Rocket'=>'\MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket', 'Airplane'=>'\MyNamespace\MyApp\Vehicle\AirVehicle\Airplane\Airplane' ]] ] ], ]; //Creating works correctly foreach($entities as $grandparentName=>$grandparent) { //createObj($em, $grandparent['class']); //Abstract foreach($grandparent['children'] as $parentName=>$parent) { //createObj($em, $parent['class']); //Abstract foreach($parent['children'] as $childName=>$class) { createObj($em, $class); } } } displayMember($em, '\MyNamespace\MyApp\Vehicle\GroundVehicle\Train\Train', 37); displayMember($em, '\MyNamespace\MyApp\Vehicle\GroundVehicle\GroundVehicle', 37); displayMember($em, '\MyNamespace\MyApp\Vehicle\Vehicle', 37); foreach($entities as $grandparentName=>$grandparent) { displayAllMembers($em, $grandparent['class']); foreach($grandparent['children'] as $parentName=>$parent) { displayAllMembers($em, $parent['class']); foreach($parent['children'] as $class) { displayAllMembers($em, $class); } } } Created \MyNamespace\MyApp\Vehicle\GroundVehicle\Train\Train with ID 53 Created \MyNamespace\MyApp\Vehicle\GroundVehicle\Car\Car with ID 54 Created \MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket with ID 55 Created \MyNamespace\MyApp\Vehicle\AirVehicle\Airplane\Airplane with ID 56 \MyNamespace\MyApp\Vehicle\GroundVehicle\Train\Train - An exception occurred while executing 'SELECT t2.id AS id_3, t2.grandParentItem1 AS grandParentItem1_4, t2.grandParentItem2 AS grandParentItem2_5, t1.parentItem1 AS parentItem1_6, t1.parentItem2 AS parentItem2_7, t0.childItem1 AS childItem1_8, t0.childItem2 AS childItem2_9, t2.dtype FROM train_table t0 INNER JOIN ground_vehicle t1 ON t0.id = t1.id INNER JOIN vehicle_table t2 ON t0.id = t2.id WHERE t2.id = ?' with params [37]: SQLSTATE[42S22]: Column not found: 1054 Unknown column 't2.dtype' in 'field list' \MyNamespace\MyApp\Vehicle\GroundVehicle\GroundVehicle - An exception occurred while executing 'SELECT t1.id AS id_4, t1.grandParentItem1 AS grandParentItem1_5, t1.grandParentItem2 AS grandParentItem2_6, t0.parentItem1 AS parentItem1_7, t0.parentItem2 AS parentItem2_8, t1.dtype, t2.childItem1 AS childItem1_9, t2.childItem2 AS childItem2_10, t3.childItem1 AS childItem1_11, t3.childItem2 AS childItem2_12 FROM ground_vehicle t0 INNER JOIN vehicle_table t1 ON t0.id = t1.id LEFT JOIN train_table t2 ON t0.id = t2.id LEFT JOIN car_table t3 ON t0.id = t3.id WHERE t1.id = ?' with params [37]: SQLSTATE[42S22]: Column not found: 1054 Unknown column 't1.dtype' in 'field list' \MyNamespace\MyApp\Vehicle\Vehicle - The discriminator value "train" is invalid. It must be one of "vehicle", "groundVehicle", "airVehicle". \MyNamespace\MyApp\Vehicle\Vehicle - The discriminator value "airplane" is invalid. It must be one of "vehicle", "groundVehicle", "airVehicle". \MyNamespace\MyApp\Vehicle\GroundVehicle\GroundVehicle - An exception occurred while executing 'SELECT t1.id AS id_4, t1.grandParentItem1 AS grandParentItem1_5, t1.grandParentItem2 AS grandParentItem2_6, t0.parentItem1 AS parentItem1_7, t0.parentItem2 AS parentItem2_8, t1.dtype, t2.childItem1 AS childItem1_9, t2.childItem2 AS childItem2_10, t3.childItem1 AS childItem1_11, t3.childItem2 AS childItem2_12 FROM ground_vehicle t0 INNER JOIN vehicle_table t1 ON t0.id = t1.id LEFT JOIN train_table t2 ON t0.id = t2.id LEFT JOIN car_table t3 ON t0.id = t3.id': SQLSTATE[42S22]: Column not found: 1054 Unknown column 't1.dtype' in 'field list' \MyNamespace\MyApp\Vehicle\GroundVehicle\Train\Train - An exception occurred while executing 'SELECT t2.id AS id_3, t2.grandParentItem1 AS grandParentItem1_4, t2.grandParentItem2 AS grandParentItem2_5, t1.parentItem1 AS parentItem1_6, t1.parentItem2 AS parentItem2_7, t0.childItem1 AS childItem1_8, t0.childItem2 AS childItem2_9, t2.dtype FROM train_table t0 INNER JOIN ground_vehicle t1 ON t0.id = t1.id INNER JOIN vehicle_table t2 ON t0.id = t2.id': SQLSTATE[42S22]: Column not found: 1054 Unknown column 't2.dtype' in 'field list' \MyNamespace\MyApp\Vehicle\GroundVehicle\Car\Car - An exception occurred while executing 'SELECT t2.id AS id_3, t2.grandParentItem1 AS grandParentItem1_4, t2.grandParentItem2 AS grandParentItem2_5, t1.parentItem1 AS parentItem1_6, t1.parentItem2 AS parentItem2_7, t0.childItem1 AS childItem1_8, t0.childItem2 AS childItem2_9, t2.dtype FROM car_table t0 INNER JOIN ground_vehicle t1 ON t0.id = t1.id INNER JOIN vehicle_table t2 ON t0.id = t2.id': SQLSTATE[42S22]: Column not found: 1054 Unknown column 't2.dtype' in 'field list' \MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle - An exception occurred while executing 'SELECT t1.id AS id_4, t1.grandParentItem1 AS grandParentItem1_5, t1.grandParentItem2 AS grandParentItem2_6, t0.parentItem1 AS parentItem1_7, t0.parentItem2 AS parentItem2_8, t1.dtype, t2.childItem1 AS childItem1_9, t2.childItem2 AS childItem2_10, t3.childItem1 AS childItem1_11, t3.childItem2 AS childItem2_12 FROM air_vehicle t0 INNER JOIN vehicle_table t1 ON t0.id = t1.id LEFT JOIN airplane_table t2 ON t0.id = t2.id LEFT JOIN rocket_table t3 ON t0.id = t3.id': SQLSTATE[42S22]: Column not found: 1054 Unknown column 't1.dtype' in 'field list' \MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket - An exception occurred while executing 'SELECT t2.id AS id_3, t2.grandParentItem1 AS grandParentItem1_4, t2.grandParentItem2 AS grandParentItem2_5, t1.parentItem1 AS parentItem1_6, t1.parentItem2 AS parentItem2_7, t0.childItem1 AS childItem1_8, t0.childItem2 AS childItem2_9, t2.dtype FROM rocket_table t0 INNER JOIN air_vehicle t1 ON t0.id = t1.id INNER JOIN vehicle_table t2 ON t0.id = t2.id': SQLSTATE[42S22]: Column not found: 1054 Unknown column 't2.dtype' in 'field list' \MyNamespace\MyApp\Vehicle\AirVehicle\Airplane\Airplane - An exception occurred while executing 'SELECT t2.id AS id_3, t2.grandParentItem1 AS grandParentItem1_4, t2.grandParentItem2 AS grandParentItem2_5, t1.parentItem1 AS parentItem1_6, t1.parentItem2 AS parentItem2_7, t0.childItem1 AS childItem1_8, t0.childItem2 AS childItem2_9, t2.dtype FROM airplane_table t0 INNER JOIN air_vehicle t1 ON t0.id = t1.id INNER JOIN vehicle_table t2 ON t0.id = t2.id': SQLSTATE[42S22]: Column not found: 1054 Unknown column 't2.dtype' in 'field list' Quote Link to comment Share on other sites More sharing options...
ginerjm Posted February 15, 2019 Share Posted February 15, 2019 It is really incredible how MANY different problems you encounter and have to post for us to puzzle over. So much stuff I have never imagined could be in existence and you seem to come up with reasons why they don't work for you. Do you just spend 24x7 researching things to learn about? Or do you have such a diverse workload that you have to learn all of this "stuff"? All of the things you have posted can't possibly all be connected, can they? If so it must be one heck of a project! 1 Quote Link to comment Share on other sites More sharing options...
benanamen Posted February 15, 2019 Share Posted February 15, 2019 Not a knock on you @NotionCommotion, but I agree with @ginerjm. Everything you post about is outside the realm of anything I have ever encountered in 30 years of being in the industry. To this day, I still have no clue what you are up to. I would really be interested in what you are doing, you know, the Real problem, as I often say. 1 Quote Link to comment Share on other sites More sharing options...
NotionCommotion Posted February 15, 2019 Author Share Posted February 15, 2019 Hello benanamen, I've never used a 3rd party ORM before and have previously used homespun scripts of my own. Have you ever used one, and specifically have you ever used Doctrine? The reason I put my Vehicle/AirVehicle/Rocket example together was primarily so I can get a small simple implementation working before deploying it to a more complicated application. I can successfully create new entities and store them in the database as shown by my previous post, but have not been successful retrieving all entities of a given type nor retrieving a given entity by ID. Do you know what I am doing wrong? Thanks Quote Link to comment Share on other sites More sharing options...
NotionCommotion Posted February 15, 2019 Author Share Posted February 15, 2019 Below is some sample data. SELECT *, 'airplane' FROM vehicle_table vt INNER JOIN air_vehicle av ON av.id=vt.id INNER JOIN airplane_table ap ON ap.id=av.id WHERE vt.id>=32 AND vt.id<=42 UNION SELECT *, 'rocket' FROM vehicle_table vt INNER JOIN air_vehicle av ON av.id=vt.id INNER JOIN rocket_table rt ON rt.id=av.id WHERE vt.id>=32 AND vt.id<=42 UNION SELECT *, 'car' FROM vehicle_table vt INNER JOIN ground_vehicle gv ON gv.id=vt.id INNER JOIN car_table ct ON ct.id=gv.id WHERE vt.id>=32 AND vt.id<=42 UNION SELECT *, 'train' FROM vehicle_table vt INNER JOIN ground_vehicle gv ON gv.id=vt.id INNER JOIN train_table tt ON tt.id=gv.id WHERE vt.id>=32 AND vt.id<=42; id grandParentItem1 grandParentItem2 discriminator_column id parentItem1 parentItem2 id childItem1 childItem2 type 32 Airplane g1 Airplane g2 airplane 32 Airplane p1 Airplane p2 32 Airplane c1 Airplane c2 airplane 36 Airplane g1 Airplane g2 airplane 36 Airplane p1 Airplane p2 36 Airplane c1 Airplane c2 airplane 40 Airplane g1 Airplane g2 airplane 40 Airplane p1 Airplane p2 40 Airplane c1 Airplane c2 airplane 35 Rocket g1 Rocket g2 rocket 35 Rocket p1 Rocket p2 35 Rocket c1 Rocket c2 rocket 39 Rocket g1 Rocket g2 rocket 39 Rocket p1 Rocket p2 39 Rocket c1 Rocket c2 rocket 34 Car g1 Car g2 car 34 Car p1 Car p2 34 Car c1 Car c2 car 38 Car g1 Car g2 car 38 Car p1 Car p2 38 Car c1 Car c2 car 42 Car g1 Car g2 car 42 Car p1 Car p2 42 Car c1 Car c2 car 33 Train g1 Train g2 train 33 Train p1 Train p2 33 Train c1 Train c2 train 37 Train g1 Train g2 train 37 Train p1 Train p2 37 Train c1 Train c2 train 41 Train g1 Train g2 train 41 Train p1 Train p2 41 Train c1 Train c2 train Quote Link to comment Share on other sites More sharing options...
benanamen Posted February 15, 2019 Share Posted February 15, 2019 (edited) Seems to be a DB design problem but since I still have no idea what is going on so I cant really say. You keep replying about HOW you are trying to solve a problem. I have no idea what this is really about. Best I can tell it has something to do with cars, trains, rockets and airplanes. What is the overall project at hand? Forget that you know any programming at all and you are telling me about something you want me to build for you. Edited February 15, 2019 by benanamen Quote Link to comment Share on other sites More sharing options...
NotionCommotion Posted February 15, 2019 Author Share Posted February 15, 2019 13 minutes ago, benanamen said: Seems to be a DB design problem but since I still have no idea what is going on so I cant really say. You keep replying about HOW you are trying to solve a problem. I have no idea what this is really about. Best I can tell it has something to do with cars, trains, rockets and airplanes. What is the overall project at hand? Forget that you know any programming at all and you are telling me about something you want me to build for you. I appreciate your passion to abolishing all xy problems, however, I am not asking for you to build something for me but for you to teach me something. Specifically, how to implement Class Table Inheritance using Doctrine. Quote Link to comment Share on other sites More sharing options...
benanamen Posted February 15, 2019 Share Posted February 15, 2019 I cant teach you anything correctly if I don't know you are really doing. Sure I get you are asking "how to implement Class Table Inheritance using Doctrine ", but from my position, I have no idea if that is actually the correct solution to your problem. By forcing me to focus on your attempt instead of the problem you are locking yourself out of any other potential or better solutions. If you just plain ol wanted to learn Class Table Inheritance using Doctrine, that is one thing, but it comes across as though you have deemed this to be the solution to a problem at hand. I know your not asking me to build you something. I was trying to get across an easy way for me to understand what I was asking of you. The very nature of all your posts being outside the realm of what many of us with numerous years experience have ever seen makes it even more important to know what the actual project is. Honestly, I have often wondered if PHP is even the right language for whatever it is you are doing. Since I, and others have no clue to what it is, who's to say. 1 Quote Link to comment Share on other sites More sharing options...
NotionCommotion Posted February 15, 2019 Author Share Posted February 15, 2019 @benanamen, I am building a web interface to manage various industrial integration gateways. Some act as servers and others act as clients. Some utilize ethernet and others utilize rs-485 serial communication. Typical protocols include modbus, devicenet, bacnet, lonworks, profibus, etc. To implement this, I am creating an object (with injected other objects) for each which fulfills the required functionality. There are some portions where inheritance is well fit and I wish to extend classes. Current implementation uses a mapper class to pull the various properties from the db which are injected into an entity object. Everything is vanilla PHP without some 3rd party framework and it works as desired, but is becoming more and more difficult to manage, and I feel that maybe I should be using some dedicated orm. Maybe I shouldn't be using an orm (and if so, whether it should be doctrine), but the only way I know how to confirm this is to personally try it out and create new entities, retrieve one by its ID, retrieve a set of them, modify them, etc. And while I can do this initially for the entire application, it is much simpler to do so for a mock application of vehicles, rockets, etc. So... assuming this is just an academic exercise to create a Rocket that is inherited from a Vehicle, does my entity meta data look reasonable? Do you know why I am unable to retrieve an entity by ID or retrieve a group of entities? Thanks Quote Link to comment Share on other sites More sharing options...
NotionCommotion Posted February 15, 2019 Author Share Posted February 15, 2019 (edited) Immediate issue solved. It appears that all extended classes (and not just intermediate extended classes) need to included in the grandparent's explicit distriminatorMap. Also, at least one of the intermediate extended classes needs to have an explicit distriminatorMap. Also, the distriminatorColumn needs to be defined in any extended classes (i.e. AirVehicles and GroundVehicles) which also extend other classes, and needs to use the same name as the grandparent's distriminatorColumn. I didn't come across any documentation to this effect, but it seems to work as desired. #MyNamespace.MyApp.Vehicle.Vehicle.dcm.yml MyNamespace\MyApp\Vehicle\Vehicle: type: entity table: vehicle_table inheritanceType: JOINED discriminatorColumn: name: discriminator_column type: string discriminatorMap: vehicle: Vehicle airvehicle: MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle car: MyNamespace\MyApp\Vehicle\GroundVehicle\Car\Car train: MyNamespace\MyApp\Vehicle\GroundVehicle\Train\Train groundvehicle: MyNamespace\MyApp\Vehicle\GroundVehicle\GroundVehicle airplane: MyNamespace\MyApp\Vehicle\AirVehicle\Airplane\Airplane rocket: MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket repositoryClass: VehicleRepository id: id: type: integer generator: strategy: AUTO fields: grandParentItem1: type: string grandParentItem2: type: string #MyNamespace.MyApp.Vehicle.AirVehicle.AirVehicle.dcm.yml MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle: type: entity table: air_vehicle extends: MyNamespace\MyApp\Vehicle\Vehicle inheritanceType: JOINED discriminatorColumn: name: discriminator_column type: string discriminatorMap: airVehicle: AirVehicle airplane: MyNamespace\MyApp\Vehicle\AirVehicle\Airplane\Airplane rocket: MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket repositoryClass: AirVehicleRepository id: id: associationKey: true fields: parentItem1: type: string parentItem2: type: string <?php //use MyNamespace\MyApp; error_reporting(E_ALL); ini_set("log_errors", '1'); ini_set('display_startup_errors', '1'); ini_set('display_errors', '1'); require_once "../bootstrap.php"; function createObj($em, $class) { $cn=explode('\\', $class); $cn=$cn[count($cn)-1]; $entity = new $class(); $entity->setChildItem1("$cn c1"); $entity->setChildItem2("$cn c2"); $entity->setParentItem1("$cn p1"); $entity->setParentItem2("$cn p2"); $entity->setGrandParentItem1("$cn g1"); $entity->setGrandParentItem2("$cn g2"); try{ $em->persist($entity); $em->flush(); echo "Created $class with ID " . $entity->getId() . "\n\n"; } catch(\Exception $e) { echo($class.' - '.$e->getMessage()."\n\n"); } } function displayMember($em, $class, $id) { echo("Display Member $id for $class\n\n"); try{ $member=$em->find($class, $id); print_r($member); } catch(\Exception $e) { echo($class.' - '.$e->getMessage()."\n\n"); } } function displayAllMembers($em, $class) { echo("Diaplay All Members for $class\n\n"); $repository = $em->getRepository($class); try{ $members=$repository->findAll(); print_r($members); } catch(\Exception $e) { echo($class.' - '.$e->getMessage()."\n\n"); } } $entities=[ 'Vehicle'=>['class'=>'\MyNamespace\MyApp\Vehicle\Vehicle','children'=>[ 'AirVehicle'=>['class'=>'\MyNamespace\MyApp\Vehicle\GroundVehicle\GroundVehicle','children'=>[ 'Rocket'=>'\MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket', 'Airplane'=>'\MyNamespace\MyApp\Vehicle\AirVehicle\Airplane\Airplane' ]], 'GroundVehicle'=>['class'=>'\MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle','children'=>[ 'Train'=>'\MyNamespace\MyApp\Vehicle\GroundVehicle\Train\Train', 'Car'=>'\MyNamespace\MyApp\Vehicle\GroundVehicle\Car\Car' ]], ] ], ]; //Creating works correctly foreach($entities as $grandparentName=>$grandparent) { //createObj($em, $grandparent['class']); //Abstract foreach($grandparent['children'] as $parentName=>$parent) { //createObj($em, $parent['class']); //Abstract foreach($parent['children'] as $childName=>$class) { createObj($em, $class); } } } displayMember($em, '\MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket', 1); displayMember($em, '\MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle', 1); displayMember($em, '\MyNamespace\MyApp\Vehicle\Vehicle', 1); foreach($entities as $grandparentName=>$grandparent) { displayAllMembers($em, $grandparent['class']); foreach($grandparent['children'] as $parentName=>$parent) { displayAllMembers($em, $parent['class']); foreach($parent['children'] as $class) { displayAllMembers($em, $class); } } } Created \MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket with ID 5 Created \MyNamespace\MyApp\Vehicle\AirVehicle\Airplane\Airplane with ID 6 Created \MyNamespace\MyApp\Vehicle\GroundVehicle\Train\Train with ID 7 Created \MyNamespace\MyApp\Vehicle\GroundVehicle\Car\Car with ID 8 Display Member 1 for \MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket Object ( [childItem1:MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket:private] => Rocket c1 [childItem2:MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket:private] => Rocket c2 [parentItem1:MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle:private] => Rocket p1 [parentItem2:MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle:private] => Rocket p2 [id:MyNamespace\MyApp\Vehicle\Vehicle:private] => 1 [grandParentItem1:MyNamespace\MyApp\Vehicle\Vehicle:private] => Rocket g1 [grandParentItem2:MyNamespace\MyApp\Vehicle\Vehicle:private] => Rocket g2 ) Display Member 1 for \MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket Object ( [childItem1:MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket:private] => Rocket c1 [childItem2:MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket:private] => Rocket c2 [parentItem1:MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle:private] => Rocket p1 [parentItem2:MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle:private] => Rocket p2 [id:MyNamespace\MyApp\Vehicle\Vehicle:private] => 1 [grandParentItem1:MyNamespace\MyApp\Vehicle\Vehicle:private] => Rocket g1 [grandParentItem2:MyNamespace\MyApp\Vehicle\Vehicle:private] => Rocket g2 ) Display Member 1 for \MyNamespace\MyApp\Vehicle\Vehicle MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket Object ( [childItem1:MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket:private] => Rocket c1 [childItem2:MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket:private] => Rocket c2 [parentItem1:MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle:private] => Rocket p1 [parentItem2:MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle:private] => Rocket p2 [id:MyNamespace\MyApp\Vehicle\Vehicle:private] => 1 [grandParentItem1:MyNamespace\MyApp\Vehicle\Vehicle:private] => Rocket g1 [grandParentItem2:MyNamespace\MyApp\Vehicle\Vehicle:private] => Rocket g2 ) Diaplay All Members for \MyNamespace\MyApp\Vehicle\Vehicle Array ( [0] => MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket Object ( [childItem1:MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket:private] => Rocket c1 [childItem2:MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket:private] => Rocket c2 [parentItem1:MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle:private] => Rocket p1 [parentItem2:MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle:private] => Rocket p2 [id:MyNamespace\MyApp\Vehicle\Vehicle:private] => 1 [grandParentItem1:MyNamespace\MyApp\Vehicle\Vehicle:private] => Rocket g1 [grandParentItem2:MyNamespace\MyApp\Vehicle\Vehicle:private] => Rocket g2 ) [1] => MyNamespace\MyApp\Vehicle\AirVehicle\Airplane\Airplane Object ( [childItem1:MyNamespace\MyApp\Vehicle\AirVehicle\Airplane\Airplane:private] => Airplane c1 [childItem2:MyNamespace\MyApp\Vehicle\AirVehicle\Airplane\Airplane:private] => Airplane c2 [parentItem1:MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle:private] => Airplane p1 [parentItem2:MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle:private] => Airplane p2 [id:MyNamespace\MyApp\Vehicle\Vehicle:private] => 2 [grandParentItem1:MyNamespace\MyApp\Vehicle\Vehicle:private] => Airplane g1 [grandParentItem2:MyNamespace\MyApp\Vehicle\Vehicle:private] => Airplane g2 ) [2] => MyNamespace\MyApp\Vehicle\GroundVehicle\Train\Train Object ( [childItem1:MyNamespace\MyApp\Vehicle\GroundVehicle\Train\Train:private] => Train c1 [childItem2:MyNamespace\MyApp\Vehicle\GroundVehicle\Train\Train:private] => Train c2 [parentItem1:MyNamespace\MyApp\Vehicle\GroundVehicle\GroundVehicle:private] => Train p1 [parentItem2:MyNamespace\MyApp\Vehicle\GroundVehicle\GroundVehicle:private] => Train p2 [id:MyNamespace\MyApp\Vehicle\Vehicle:private] => 3 [grandParentItem1:MyNamespace\MyApp\Vehicle\Vehicle:private] => Train g1 [grandParentItem2:MyNamespace\MyApp\Vehicle\Vehicle:private] => Train g2 ) [3] => MyNamespace\MyApp\Vehicle\GroundVehicle\Car\Car Object ( [childItem1:MyNamespace\MyApp\Vehicle\GroundVehicle\Car\Car:private] => Car c1 [childItem2:MyNamespace\MyApp\Vehicle\GroundVehicle\Car\Car:private] => Car c2 [parentItem1:MyNamespace\MyApp\Vehicle\GroundVehicle\GroundVehicle:private] => Car p1 [parentItem2:MyNamespace\MyApp\Vehicle\GroundVehicle\GroundVehicle:private] => Car p2 [id:MyNamespace\MyApp\Vehicle\Vehicle:private] => 4 [grandParentItem1:MyNamespace\MyApp\Vehicle\Vehicle:private] => Car g1 [grandParentItem2:MyNamespace\MyApp\Vehicle\Vehicle:private] => Car g2 ) [4] => MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket Object ( [childItem1:MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket:private] => Rocket c1 [childItem2:MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket:private] => Rocket c2 [parentItem1:MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle:private] => Rocket p1 [parentItem2:MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle:private] => Rocket p2 [id:MyNamespace\MyApp\Vehicle\Vehicle:private] => 5 [grandParentItem1:MyNamespace\MyApp\Vehicle\Vehicle:private] => Rocket g1 [grandParentItem2:MyNamespace\MyApp\Vehicle\Vehicle:private] => Rocket g2 ) [5] => MyNamespace\MyApp\Vehicle\AirVehicle\Airplane\Airplane Object ( [childItem1:MyNamespace\MyApp\Vehicle\AirVehicle\Airplane\Airplane:private] => Airplane c1 [childItem2:MyNamespace\MyApp\Vehicle\AirVehicle\Airplane\Airplane:private] => Airplane c2 [parentItem1:MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle:private] => Airplane p1 [parentItem2:MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle:private] => Airplane p2 [id:MyNamespace\MyApp\Vehicle\Vehicle:private] => 6 [grandParentItem1:MyNamespace\MyApp\Vehicle\Vehicle:private] => Airplane g1 [grandParentItem2:MyNamespace\MyApp\Vehicle\Vehicle:private] => Airplane g2 ) [6] => MyNamespace\MyApp\Vehicle\GroundVehicle\Train\Train Object ( [childItem1:MyNamespace\MyApp\Vehicle\GroundVehicle\Train\Train:private] => Train c1 [childItem2:MyNamespace\MyApp\Vehicle\GroundVehicle\Train\Train:private] => Train c2 [parentItem1:MyNamespace\MyApp\Vehicle\GroundVehicle\GroundVehicle:private] => Train p1 [parentItem2:MyNamespace\MyApp\Vehicle\GroundVehicle\GroundVehicle:private] => Train p2 [id:MyNamespace\MyApp\Vehicle\Vehicle:private] => 7 [grandParentItem1:MyNamespace\MyApp\Vehicle\Vehicle:private] => Train g1 [grandParentItem2:MyNamespace\MyApp\Vehicle\Vehicle:private] => Train g2 ) [7] => MyNamespace\MyApp\Vehicle\GroundVehicle\Car\Car Object ( [childItem1:MyNamespace\MyApp\Vehicle\GroundVehicle\Car\Car:private] => Car c1 [childItem2:MyNamespace\MyApp\Vehicle\GroundVehicle\Car\Car:private] => Car c2 [parentItem1:MyNamespace\MyApp\Vehicle\GroundVehicle\GroundVehicle:private] => Car p1 [parentItem2:MyNamespace\MyApp\Vehicle\GroundVehicle\GroundVehicle:private] => Car p2 [id:MyNamespace\MyApp\Vehicle\Vehicle:private] => 8 [grandParentItem1:MyNamespace\MyApp\Vehicle\Vehicle:private] => Car g1 [grandParentItem2:MyNamespace\MyApp\Vehicle\Vehicle:private] => Car g2 ) ) Diaplay All Members for \MyNamespace\MyApp\Vehicle\GroundVehicle\GroundVehicle Array ( [0] => MyNamespace\MyApp\Vehicle\GroundVehicle\Train\Train Object ( [childItem1:MyNamespace\MyApp\Vehicle\GroundVehicle\Train\Train:private] => Train c1 [childItem2:MyNamespace\MyApp\Vehicle\GroundVehicle\Train\Train:private] => Train c2 [parentItem1:MyNamespace\MyApp\Vehicle\GroundVehicle\GroundVehicle:private] => Train p1 [parentItem2:MyNamespace\MyApp\Vehicle\GroundVehicle\GroundVehicle:private] => Train p2 [id:MyNamespace\MyApp\Vehicle\Vehicle:private] => 3 [grandParentItem1:MyNamespace\MyApp\Vehicle\Vehicle:private] => Train g1 [grandParentItem2:MyNamespace\MyApp\Vehicle\Vehicle:private] => Train g2 ) [1] => MyNamespace\MyApp\Vehicle\GroundVehicle\Car\Car Object ( [childItem1:MyNamespace\MyApp\Vehicle\GroundVehicle\Car\Car:private] => Car c1 [childItem2:MyNamespace\MyApp\Vehicle\GroundVehicle\Car\Car:private] => Car c2 [parentItem1:MyNamespace\MyApp\Vehicle\GroundVehicle\GroundVehicle:private] => Car p1 [parentItem2:MyNamespace\MyApp\Vehicle\GroundVehicle\GroundVehicle:private] => Car p2 [id:MyNamespace\MyApp\Vehicle\Vehicle:private] => 4 [grandParentItem1:MyNamespace\MyApp\Vehicle\Vehicle:private] => Car g1 [grandParentItem2:MyNamespace\MyApp\Vehicle\Vehicle:private] => Car g2 ) [2] => MyNamespace\MyApp\Vehicle\GroundVehicle\Train\Train Object ( [childItem1:MyNamespace\MyApp\Vehicle\GroundVehicle\Train\Train:private] => Train c1 [childItem2:MyNamespace\MyApp\Vehicle\GroundVehicle\Train\Train:private] => Train c2 [parentItem1:MyNamespace\MyApp\Vehicle\GroundVehicle\GroundVehicle:private] => Train p1 [parentItem2:MyNamespace\MyApp\Vehicle\GroundVehicle\GroundVehicle:private] => Train p2 [id:MyNamespace\MyApp\Vehicle\Vehicle:private] => 7 [grandParentItem1:MyNamespace\MyApp\Vehicle\Vehicle:private] => Train g1 [grandParentItem2:MyNamespace\MyApp\Vehicle\Vehicle:private] => Train g2 ) [3] => MyNamespace\MyApp\Vehicle\GroundVehicle\Car\Car Object ( [childItem1:MyNamespace\MyApp\Vehicle\GroundVehicle\Car\Car:private] => Car c1 [childItem2:MyNamespace\MyApp\Vehicle\GroundVehicle\Car\Car:private] => Car c2 [parentItem1:MyNamespace\MyApp\Vehicle\GroundVehicle\GroundVehicle:private] => Car p1 [parentItem2:MyNamespace\MyApp\Vehicle\GroundVehicle\GroundVehicle:private] => Car p2 [id:MyNamespace\MyApp\Vehicle\Vehicle:private] => 8 [grandParentItem1:MyNamespace\MyApp\Vehicle\Vehicle:private] => Car g1 [grandParentItem2:MyNamespace\MyApp\Vehicle\Vehicle:private] => Car g2 ) ) Diaplay All Members for \MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket Array ( [0] => MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket Object ( [childItem1:MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket:private] => Rocket c1 [childItem2:MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket:private] => Rocket c2 [parentItem1:MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle:private] => Rocket p1 [parentItem2:MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle:private] => Rocket p2 [id:MyNamespace\MyApp\Vehicle\Vehicle:private] => 1 [grandParentItem1:MyNamespace\MyApp\Vehicle\Vehicle:private] => Rocket g1 [grandParentItem2:MyNamespace\MyApp\Vehicle\Vehicle:private] => Rocket g2 ) [1] => MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket Object ( [childItem1:MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket:private] => Rocket c1 [childItem2:MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket:private] => Rocket c2 [parentItem1:MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle:private] => Rocket p1 [parentItem2:MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle:private] => Rocket p2 [id:MyNamespace\MyApp\Vehicle\Vehicle:private] => 5 [grandParentItem1:MyNamespace\MyApp\Vehicle\Vehicle:private] => Rocket g1 [grandParentItem2:MyNamespace\MyApp\Vehicle\Vehicle:private] => Rocket g2 ) ) Diaplay All Members for \MyNamespace\MyApp\Vehicle\AirVehicle\Airplane\Airplane Array ( [0] => MyNamespace\MyApp\Vehicle\AirVehicle\Airplane\Airplane Object ( [childItem1:MyNamespace\MyApp\Vehicle\AirVehicle\Airplane\Airplane:private] => Airplane c1 [childItem2:MyNamespace\MyApp\Vehicle\AirVehicle\Airplane\Airplane:private] => Airplane c2 [parentItem1:MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle:private] => Airplane p1 [parentItem2:MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle:private] => Airplane p2 [id:MyNamespace\MyApp\Vehicle\Vehicle:private] => 2 [grandParentItem1:MyNamespace\MyApp\Vehicle\Vehicle:private] => Airplane g1 [grandParentItem2:MyNamespace\MyApp\Vehicle\Vehicle:private] => Airplane g2 ) [1] => MyNamespace\MyApp\Vehicle\AirVehicle\Airplane\Airplane Object ( [childItem1:MyNamespace\MyApp\Vehicle\AirVehicle\Airplane\Airplane:private] => Airplane c1 [childItem2:MyNamespace\MyApp\Vehicle\AirVehicle\Airplane\Airplane:private] => Airplane c2 [parentItem1:MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle:private] => Airplane p1 [parentItem2:MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle:private] => Airplane p2 [id:MyNamespace\MyApp\Vehicle\Vehicle:private] => 6 [grandParentItem1:MyNamespace\MyApp\Vehicle\Vehicle:private] => Airplane g1 [grandParentItem2:MyNamespace\MyApp\Vehicle\Vehicle:private] => Airplane g2 ) ) Diaplay All Members for \MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle Array ( [0] => MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket Object ( [childItem1:MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket:private] => Rocket c1 [childItem2:MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket:private] => Rocket c2 [parentItem1:MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle:private] => Rocket p1 [parentItem2:MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle:private] => Rocket p2 [id:MyNamespace\MyApp\Vehicle\Vehicle:private] => 1 [grandParentItem1:MyNamespace\MyApp\Vehicle\Vehicle:private] => Rocket g1 [grandParentItem2:MyNamespace\MyApp\Vehicle\Vehicle:private] => Rocket g2 ) [1] => MyNamespace\MyApp\Vehicle\AirVehicle\Airplane\Airplane Object ( [childItem1:MyNamespace\MyApp\Vehicle\AirVehicle\Airplane\Airplane:private] => Airplane c1 [childItem2:MyNamespace\MyApp\Vehicle\AirVehicle\Airplane\Airplane:private] => Airplane c2 [parentItem1:MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle:private] => Airplane p1 [parentItem2:MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle:private] => Airplane p2 [id:MyNamespace\MyApp\Vehicle\Vehicle:private] => 2 [grandParentItem1:MyNamespace\MyApp\Vehicle\Vehicle:private] => Airplane g1 [grandParentItem2:MyNamespace\MyApp\Vehicle\Vehicle:private] => Airplane g2 ) [2] => MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket Object ( [childItem1:MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket:private] => Rocket c1 [childItem2:MyNamespace\MyApp\Vehicle\AirVehicle\Rocket\Rocket:private] => Rocket c2 [parentItem1:MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle:private] => Rocket p1 [parentItem2:MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle:private] => Rocket p2 [id:MyNamespace\MyApp\Vehicle\Vehicle:private] => 5 [grandParentItem1:MyNamespace\MyApp\Vehicle\Vehicle:private] => Rocket g1 [grandParentItem2:MyNamespace\MyApp\Vehicle\Vehicle:private] => Rocket g2 ) [3] => MyNamespace\MyApp\Vehicle\AirVehicle\Airplane\Airplane Object ( [childItem1:MyNamespace\MyApp\Vehicle\AirVehicle\Airplane\Airplane:private] => Airplane c1 [childItem2:MyNamespace\MyApp\Vehicle\AirVehicle\Airplane\Airplane:private] => Airplane c2 [parentItem1:MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle:private] => Airplane p1 [parentItem2:MyNamespace\MyApp\Vehicle\AirVehicle\AirVehicle:private] => Airplane p2 [id:MyNamespace\MyApp\Vehicle\Vehicle:private] => 6 [grandParentItem1:MyNamespace\MyApp\Vehicle\Vehicle:private] => Airplane g1 [grandParentItem2:MyNamespace\MyApp\Vehicle\Vehicle:private] => Airplane g2 ) ) Diaplay All Members for \MyNamespace\MyApp\Vehicle\GroundVehicle\Train\Train Array ( [0] => MyNamespace\MyApp\Vehicle\GroundVehicle\Train\Train Object ( [childItem1:MyNamespace\MyApp\Vehicle\GroundVehicle\Train\Train:private] => Train c1 [childItem2:MyNamespace\MyApp\Vehicle\GroundVehicle\Train\Train:private] => Train c2 [parentItem1:MyNamespace\MyApp\Vehicle\GroundVehicle\GroundVehicle:private] => Train p1 [parentItem2:MyNamespace\MyApp\Vehicle\GroundVehicle\GroundVehicle:private] => Train p2 [id:MyNamespace\MyApp\Vehicle\Vehicle:private] => 3 [grandParentItem1:MyNamespace\MyApp\Vehicle\Vehicle:private] => Train g1 [grandParentItem2:MyNamespace\MyApp\Vehicle\Vehicle:private] => Train g2 ) [1] => MyNamespace\MyApp\Vehicle\GroundVehicle\Train\Train Object ( [childItem1:MyNamespace\MyApp\Vehicle\GroundVehicle\Train\Train:private] => Train c1 [childItem2:MyNamespace\MyApp\Vehicle\GroundVehicle\Train\Train:private] => Train c2 [parentItem1:MyNamespace\MyApp\Vehicle\GroundVehicle\GroundVehicle:private] => Train p1 [parentItem2:MyNamespace\MyApp\Vehicle\GroundVehicle\GroundVehicle:private] => Train p2 [id:MyNamespace\MyApp\Vehicle\Vehicle:private] => 7 [grandParentItem1:MyNamespace\MyApp\Vehicle\Vehicle:private] => Train g1 [grandParentItem2:MyNamespace\MyApp\Vehicle\Vehicle:private] => Train g2 ) ) Diaplay All Members for \MyNamespace\MyApp\Vehicle\GroundVehicle\Car\Car Array ( [0] => MyNamespace\MyApp\Vehicle\GroundVehicle\Car\Car Object ( [childItem1:MyNamespace\MyApp\Vehicle\GroundVehicle\Car\Car:private] => Car c1 [childItem2:MyNamespace\MyApp\Vehicle\GroundVehicle\Car\Car:private] => Car c2 [parentItem1:MyNamespace\MyApp\Vehicle\GroundVehicle\GroundVehicle:private] => Car p1 [parentItem2:MyNamespace\MyApp\Vehicle\GroundVehicle\GroundVehicle:private] => Car p2 [id:MyNamespace\MyApp\Vehicle\Vehicle:private] => 4 [grandParentItem1:MyNamespace\MyApp\Vehicle\Vehicle:private] => Car g1 [grandParentItem2:MyNamespace\MyApp\Vehicle\Vehicle:private] => Car g2 ) [1] => MyNamespace\MyApp\Vehicle\GroundVehicle\Car\Car Object ( [childItem1:MyNamespace\MyApp\Vehicle\GroundVehicle\Car\Car:private] => Car c1 [childItem2:MyNamespace\MyApp\Vehicle\GroundVehicle\Car\Car:private] => Car c2 [parentItem1:MyNamespace\MyApp\Vehicle\GroundVehicle\GroundVehicle:private] => Car p1 [parentItem2:MyNamespace\MyApp\Vehicle\GroundVehicle\GroundVehicle:private] => Car p2 [id:MyNamespace\MyApp\Vehicle\Vehicle:private] => 8 [grandParentItem1:MyNamespace\MyApp\Vehicle\Vehicle:private] => Car g1 [grandParentItem2:MyNamespace\MyApp\Vehicle\Vehicle:private] => Car g2 ) ) Edited February 15, 2019 by NotionCommotion Quote Link to comment Share on other sites More sharing options...
benanamen Posted February 16, 2019 Share Posted February 16, 2019 @NotionCommotion, thanks, that explanation is exactly what I was getting at. It helps put everything in perspective. Glad you figured out the problem. Quote Link to comment Share on other sites More sharing options...
NotionCommotion Posted February 17, 2019 Author Share Posted February 17, 2019 Yes, I am glad too. Does it look like it is all being done "correctly"? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.