private function createFieldType($contentType, $parent, $type, $name, $label, $deleted, $orderKey, $many, $editOptions) { $fieldType = new FieldType(); if ($parent != '') { $fieldType->setParent($this->getReference($parent)); } else { $fieldType->setContentType($this->getReference($contentType)); $this->getReference($contentType)->setFieldType($fieldType); } $fieldType->setType('AppBundle\\Form\\DataField\\' . $type . 'Type'); $fieldType->setName($name); $fieldType->setLabel($label); $fieldType->setDeleted($deleted); $fieldType->setOrderKey($orderKey); $fieldType->setMany($many); $fieldType->setEditOptions($editOptions); return $fieldType; }
function __construct() { $this->templates = new \Doctrine\Common\Collections\ArrayCollection(); $this->views = new \Doctrine\Common\Collections\ArrayCollection(); $this->dirty = true; $this->editTwigWithWysiwyg = true; $fieldType = new FieldType(); $fieldType->setName('source'); // $fieldType->setDeleted ( false ); // $fieldType->setOrderKey( false ); $fieldType->setType(ContainerFieldType::class); $fieldType->setContentType($this); $this->setFieldType($fieldType); $this->setAskForOuuid(true); }