Пример #1
0
 public function testValueSet()
 {
     $expected = new ValueSet();
     $content = new Content();
     $content->setValueSet($expected);
     $actual = $content->getValueSet();
     $this->assertSame($expected, $actual);
 }
Пример #2
0
 /**
  * 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;
 }