Ejemplo n.º 1
0
 /**
  * {@inheritDoc}
  */
 public function load(ObjectManager $manager)
 {
     /**
      * Create field "title" for module "employees".
      */
     $field1 = new Field();
     $field1->setModule($this->getReference('module-employees'));
     $field1->setFieldset($this->getReference('fieldset-details'));
     $field1->setName('Title');
     $field1->setColumnType('string');
     $field1->setFormType('text');
     $field1->setIdentifier('title');
     $field1->setSequence(1);
     $manager->persist($field1);
     /**
      * Create field "description" for module "employees".
      */
     $field2 = new Field();
     $field2->setModule($this->getReference('module-employees'));
     $field2->setFieldset($this->getReference('fieldset-details'));
     $field2->setName('Description');
     $field2->setColumnType('text');
     $field2->setFormType('textarea');
     $field2->setIdentifier('description');
     $field2->setSequence(2);
     $manager->persist($field2);
     $manager->flush();
     $this->addReference('field-title', $field1);
     $this->addReference('field-description', $field2);
 }