예제 #1
0
 /**
  * Get a form by a schema
  *
  * @param string $schema
  *
  * @return FormView
  */
 public function formFromValue(FormValue $value)
 {
     if (null === ($schema = $value->getSchema())) {
         return false;
     }
     $entity = $this->eavManager->initializeEntity($schema);
     $form = $this->formFactory->create('eav_post', $entity, ['valueId' => $value->getId()]);
     return $form->createView();
 }
예제 #2
0
 public function testSchema()
 {
     $formValue = new FormValue();
     $schema = new Schema();
     $expected = $schema;
     $formValue->setSchema($schema);
     $actual = $formValue->getSchema();
     $this->assertSame($expected, $actual);
 }