private function updateContentSetElements(ContentSet $content, array $elementsData, Page $page = null)
    {
        $content->clear();
        foreach ($elementsData as $data) {
            if ($data instanceof AbstractClassContent) {
                if (null !== $page && null === $data->getMainNode()) {
                    $data->setMainNode($page);
                }
                $content->push($data);
            }
        }

        return $this;
    }