public function persist(ObjectManager $manager)
    {
        foreach ($this->entities as $entity) {
            $manager->persist($entity);
        }

        if ($this->root) {
            $manager->persist($this->root);
        }
    }