public function addPagePartToPage($nodeOrInternalName, PagePartInterface $pagePart, $language, $context = 'main', $position = null)
    {
        // Find the correct page instance.
        $node = $this->getNode($nodeOrInternalName);
        /** @var $translation NodeTranslation */
        $translation = $node->getNodeTranslation($language, true);
        /** @var HasPagePartsInterface $page */
        $page = $translation->getRef($this->em);

        // Find latest position.
        if (is_null($position)) {
            $pageParts = $this->pagePartRepo->getPagePartRefs($page, $context);
            $position = count($pageParts) + 1;
        }

        $this->em->persist($pagePart);
        $this->em->flush();

        $this->pagePartRepo->addPagePart($page, $pagePart, $position, $context);
    }