public function createField($name, $isRequired, $type, ResourceNode $resourceNode = null)
    {
        $fieldFacet = new FieldFacet();
        $fieldFacet->setLabel($name);
        $fieldFacet->setType($type);
        $fieldFacet->setRequired($isRequired);
        $fieldFacet->setResourceNode($resourceNode);
        $this->om->persist($fieldFacet);
        $this->om->flush();

        return $fieldFacet;
    }