So the class OrganisationEntity implements the Node interface and the classes Company, Branch and Store are direct subclasses. When an entity is retrieved from the DB it is an instance of the appropriate class. Now when a branch has several stores as descendents and I want to delete the branch, it will NOT delete the stores. The reason is that delete() (and several other calls) pass the class: get_class($this->getNode()) to the querybuilder. Therefore, deleting a Branch will not delete the stores, because these are different classes.
I have made the same changes that were done to shiftRLRange in commit c84f0d93cf16c2e0abde538b34fe70776d853a25 (Little fix to make it works with Inheritance) to several other calls (delete, moveBetweenTrees, etc):
I have the following metadata for the class that implements the Node interface:
So the class OrganisationEntity implements the Node interface and the classes Company, Branch and Store are direct subclasses. When an entity is retrieved from the DB it is an instance of the appropriate class. Now when a branch has several stores as descendents and I want to delete the branch, it will NOT delete the stores. The reason is that delete() (and several other calls) pass the class: get_class($this->getNode()) to the querybuilder. Therefore, deleting a Branch will not delete the stores, because these are different classes.
I have made the same changes that were done to shiftRLRange in commit c84f0d93cf16c2e0abde538b34fe70776d853a25 (Little fix to make it works with Inheritance) to several other calls (delete, moveBetweenTrees, etc):
Added line:
Replaced:
with $metadata->rootEntityName So far it seems to work for delete. Haven't tested the other methods.