/** * Creates a ValueSet entity for Content when missing and there is a ContentType set. * * @param Content $content * * @return Content */ public function createMissingValueSet(Content $content) { if ($content->getContentType() !== null && $content->getValueSet() === null) { $valueSet = new ValueSet(); $this->em->persist($valueSet); $valueSet->setSchema($content->getContentType()->getSchema()); $content->setValueSet($valueSet); $content = $this->save($content); } return $content; }