public function saveWithSection(Page $page, Section $currentParent = null)
    {
        if ($page->hasMainSection()) {
            return $page;
        }

        if (false === $this->_em->contains($page)) {
            $this->_em->persist($page);
        }

        $parent = $page->getSection();
        if (null !== $currentParent && $this->_em->getUnitOfWork()->isScheduledForInsert($currentParent)) {
            $this->_em->detach($currentParent);
        }

        $section = new Section($page->getUid(), ['page' => $page, 'site' => $page->getSite()]);

        $this->getEntityManager()
                ->getRepository('BackBee\NestedNode\Section')
                ->insertNodeAsFirstChildOf($section, $parent);

        return $page->setPosition(0)
                    ->setLevel($section->getLevel());
    }