public function removeStructureNodeRelatedByStructureNodeId(ChildStructureNode $structureNodeRelatedByStructureNodeId)
    {
        if ($this->getStructureNodesRelatedByStructureNodeId()->contains($structureNodeRelatedByStructureNodeId)) { $structureNodeParent = new ChildStructureNodeParent();

            $structureNodeParent->setStructureNodeRelatedByStructureNodeId($structureNodeRelatedByStructureNodeId);
            if ($structureNodeRelatedByStructureNodeId->isStructureNodeRelatedByParentIdsLoaded()) {
                //remove the back reference if available
                $structureNodeRelatedByStructureNodeId->getStructureNodeRelatedByParentIds()->removeObject($this);
            }

            $structureNodeParent->setStructureNodeRelatedByParentId($this);
            $this->removeStructureNodeParentRelatedByParentId(clone $structureNodeParent);
            $structureNodeParent->clear();

            $this->collStructureNodesRelatedByStructureNodeId->remove($this->collStructureNodesRelatedByStructureNodeId->search($structureNodeRelatedByStructureNodeId));

            if (null === $this->structureNodesRelatedByStructureNodeIdScheduledForDeletion) {
                $this->structureNodesRelatedByStructureNodeIdScheduledForDeletion = clone $this->collStructureNodesRelatedByStructureNodeId;
                $this->structureNodesRelatedByStructureNodeIdScheduledForDeletion->clear();
            }

            $this->structureNodesRelatedByStructureNodeIdScheduledForDeletion->push($structureNodeRelatedByStructureNodeId);
        }


        return $this;
    }