Version: current

# Class UserDefinedForm

User Defined Form Page type that lets users build a form in the CMS using the FieldEditor Field.

  Object
  ViewableData implements IteratorAggregate
  DataObject implements DataObjectInterface, i18nEntityProvider
  SiteTree implements PermissionProvider, i18nEntityProvider
  Page
  UserDefinedForm

### Direct known subclasses

`SimpleOrderForm`

Package: userforms
Located at userforms/code/model/UserDefinedForm.php

## Methods summary

`public static` | # `set_extended_mode( mixed $mode = false )` Change extended mode Change extended mode
`public` | # `populateDefaults( )` Load the default values in from the self::$defaults array. Will traverse the defaults of the current class and all its parent classes. Called by the constructor when creating new records. Load the default values in from the self::$defaults array. Will traverse the defaults of the current class and all its parent classes. Called by the constructor when creating new records. #### Uses ``DataObjectDecorator::populateDefaults()`` #### Overrides `Page::populateDefaults`
`public `FieldSet`` | # `getCMSFields( )` Setup the CMS Fields for the User Defined Form Setup the CMS Fields for the User Defined Form #### Returns ``FieldSet`` FieldSet #### Overrides `Page::getCMSFields`
`public` | # `onAfterDelete( )` #### Overrides `Page::onAfterDelete`
`public` | # `doPublish( )` Publishing Versioning support. Publishing Versioning support. When publishing copy the editable form fields to the live database Not going to version emails and submissions as they are likely to persist over multiple versions #### Overrides `SiteTree::doPublish`
`public` | # `doUnpublish( )` Unpublishing Versioning support Unpublishing Versioning support When unpublishing the page it has to remove all the fields from the live database table #### Overrides `SiteTree::doUnpublish`
`public` | # `doRollbackTo( String|integer $version )` Roll back a form to a previous version. Roll back a form to a previous version. #### Parameters $version String|int Version to roll back to #### Overrides `SiteTree::doRollbackTo`
`public` | # `doRevertToLive( )` Revert the draft site to the current live site Revert the draft site to the current live site #### Overrides `SiteTree::doRevertToLive`
`public `Page`` | # `duplicate( mixed $doWrite = true )` Duplicate this UserDefinedForm page, and its form fields. Submissions, on the other hand, won't be duplicated. Duplicate this UserDefinedForm page, and its form fields. Submissions, on the other hand, won't be duplicated. #### Parameters $doWrite $doWrite Perform a write() operation before returning the object. If this is true, it will create the duplicate in the database. #### Returns ``Page`` Page #### Overrides `SiteTree::duplicate`
`public `FieldSet`` | # `getFormOptions( )` Custom options for the form. You can extend the built in options by using updateFormOptions() Custom options for the form. You can extend the built in options by using updateFormOptions() #### Returns ``FieldSet`` FieldSet
`public boolean` | # `getIsModifiedOnStage( )` Return if this form has been modified on the stage site and not published. this is used on the workflow module and for a couple highlighting things Return if this form has been modified on the stage site and not published. this is used on the workflow module and for a couple highlighting things #### Returns `boolean` boolean #### Overrides `SiteTree::getIsModifiedOnStage`

### Methods inherited from Page

`AdminEmail()`, `DevMode()`, `FinalParent()`, `Lang()`, `Locale()`, `MetaTags()`, `NestedValue()`, `allowComments()`, `canAddChildren()`, `canDelete()`, `canDeleteFromLive()`, `canEdit()`, `canPublish()`, `checkDevPermisson()`, `hiddenCMSFields()`, `hide_cms_fields()`, `onAfterWrite()`, `onBeforeWrite()`, `set_hidden_cms_fields()`

### Methods inherited from SiteTree

`AbsoluteLink()`, `Breadcrumbs()`, `CMSTreeClasses()`, `Comments()`, `ContentSource()`, `DependentPages()`, `DependentPagesCount()`, `ElementName()`, `InSection()`, `Level()`, `Link()`, `LinkOrCurrent()`, `LinkOrSection()`, `LinkingMode()`, `NestedTitle()`, `RelativeLink()`, `TreeTitle()`, `VirtualPages()`, `allowedChildren()`, `batch_permission_check()`, `can()`, `canCreate()`, `canView()`, `can_delete_multiple()`, `can_edit_multiple()`, `cmsCleanup_parentChanged()`, `collateDescendants()`, `defaultChild()`, `defaultParent()`, `disableCMSFieldsExtensions()`, `disable_nested_urls()`, `doDeleteFromLive()`, `doRestoreToStage()`, `duplicateAsChild()`, `duplicateWithChildren()`, `enableCMSFieldsExtensions()`, `enable_nested_urls()`, `fieldLabels()`, `generateURLSegment()`, `generate_homepage_domain_map()`, `getAbsoluteLiveLink()`, `getCMSActions()`, `getClassDropdown()`, `getExistsOnLive()`, `getIsAddedToStage()`, `getIsDeletedFromStage()`, `getMenuTitle()`, `getParent()`, `getParentType()`, `getSiteConfig()`, `get_by_link()`, `get_enforce_strict_hierarchy()`, `i18n_singular_name()`, `isCurrent()`, `isNew()`, `isPublished()`, `isSection()`, `link_shortcode_handler()`, `nested_urls()`, `onBeforeDelete()`, `page_type_classes()`, `prepopuplate_permission_cache()`, `provideI18nEntities()`, `providePermissions()`, `requireDefaultRecords()`, `reset()`, `rewriteFileURL()`, `setMenuTitle()`, `setParent()`, `set_enforce_strict_hierarchy()`, `syncLinkTracking()`, `validURLSegment()`

### Methods inherited from DataObject

`Aggregate()`, `RelationshipAggregate()`, `__construct()`, `baseTable()`, `belongs_to()`, `buildDataObjectSet()`, `buildSQL()`, `castedUpdate()`, `composite_fields()`, `context_obj()`, `customDatabaseFields()`, `custom_database_fields()`, `data()`, `databaseFields()`, `databaseIndexes()`, `database_extensions()`, `database_fields()`, `db()`, `dbObject()`, `debug()`, `defaultSearchFilters()`, `defineMethods()`, `delete()`, `delete_by_id()`, `destroy()`, `disable_subclass_access()`, `enable_subclass_access()`, `exists()`, `extendedSQL()`, `fieldLabel()`, `flushCache()`, `flush_and_destroy_cache()`, `forceChange()`, `get()`, `getAllFields()`, `getChangedFields()`, `getClassAncestry()`, `getComponent()`, `getComponents()`, `getComponentsQuery()`, `getDefaultSearchContext()`, `getField()`, `getFrontEndFields()`, `getManyManyComponents()`, `getManyManyComponentsQuery()`, `getManyManyFilter()`, `getManyManyJoin()`, `getRemoteJoinField()`, `getReverseAssociation()`, `getTitle()`, `get_by_id()`, `get_one()`, `get_validation_enabled()`, `hasDatabaseField()`, `hasField()`, `hasOwnTableDatabaseField()`, `hasValue()`, `has_many()`, `has_one()`, `has_own_table()`, `i18n_plural_name()`, `inheritedDatabaseFields()`, `instance_get()`, `instance_get_one()`, `isChanged()`, `isEmpty()`, `isInDB()`, `is_composite_field()`, `many_many()`, `many_many_extraFields()`, `merge()`, `newClassInstance()`, `plural_name()`, `relObject()`, `requireTable()`, `scaffoldFormFields()`, `scaffoldSearchFields()`, `searchableFields()`, `setCastedField()`, `setClassName()`, `setComponent()`, `setField()`, `set_context_obj()`, `set_validation_enabled()`, `singular_name()`, `summaryFields()`, `toMap()`, `update()`, `validate()`, `write()`, `writeComponents()`, `writeWithoutVersion()`

### Methods inherited from ViewableData

`ATT_val()`, `BaseHref()`, `CSSClasses()`, `ColumnBreak()`, `ColumnCalc()`, `ColumnNumber()`, `ColumnPad()`, `ColumnPos()`, `CurrentMember()`, `CurrentPage()`, `Debug()`, `Even()`, `EvenOdd()`, `First()`, `FirstLast()`, `HasPerm()`, `IsAjax()`, `JS_val()`, `Last()`, `Me()`, `Middle()`, `MiddleString()`, `Modulus()`, `MultipleOf()`, `Odd()`, `Pos()`, `RAW_val()`, `SQL_val()`, `ThemeDir()`, `ThemeName()`, `Top()`, `TotalItems()`, `XML_val()`, `__get()`, `__isset()`, `__set()`, `buildCastingCache()`, `cachedCall()`, `castingClass()`, `castingHelper()`, `castingHelperPair()`, `castingObjectCreator()`, `castingObjectCreatorPair()`, `customise()`, `escapeTypeForField()`, `getIterator()`, `getSecurityID()`, `getXMLValues()`, `i18nLocale()`, `iteratorProperties()`, `obj()`, `renderWith()`, `setCustomisedObj()`

### Methods inherited from Object

`__call()`, `__toString()`, `__wakeup()`, `addMethodsFrom()`, `addStaticVars()`, `addWrapperMethod()`, `add_extension()`, `add_static_var()`, `allMethodNames()`, `cacheToFile()`, `cacheToFileWithArgs()`, `clearCache()`, `combined_static()`, `create()`, `createMethod()`, `create_from_string()`, `extInstance()`, `extend()`, `getCustomClass()`, `getExtensionInstance()`, `getExtensionInstances()`, `get_extensions()`, `get_static()`, `hasExtension()`, `hasMethod()`, `has_extension()`, `invokeWithExtensions()`, `is_a()`, `loadCache()`, `parentClass()`, `parse_class_spec()`, `remove_extension()`, `sanitiseCachename()`, `saveCache()`, `set_stat()`, `set_static()`, `set_uninherited()`, `stat()`, `strong_create()`, `uninherited()`, `uninherited_static()`, `useCustomClass()`

### Magic methods summary

## Properties summary

`public static String` | $required_identifier | # Required Identifier Required Identifier
`public static Array` | $db | # Fields on the user defined form page. Fields on the user defined form page.
`public static Array` | $defaults | # Default values of variables when this page is created Default values of variables when this page is created
`public static array` | $extensions | # An array of extension names and parameters to be applied to this object upon construction. An array of extension names and parameters to be applied to this object upon construction. Example:
    public static $extensions = array (
      'Hierachy',
      "Version('Stage', 'Live')"
    );
Use `Object::add_extension()` to add extensions without access to the class code, e.g. to extend core classes. Extensions are instanciated together with the object and stored in `Object::$extension_instances`.
`public static Array` | $has_many | #
`public static Флаг` | $use_js_validation | # использования js-валидации использования js-валидации

### Properties inherited from Page

`$default_child`, `$hidden_cms_fields`, `$summary_fields`

### Properties inherited from SiteTree

`$allowed_children`, `$belongs_many_many`, `$breadcrumbs_delimiter`, `$cache_permissions`, `$can_be_root`, `$can_create`, `$casting`, `$default_parent`, `$default_sort`, `$has_one`, `$hide_ancestor`, `$icon`, `$indexes`, `$many_many`, `$many_many_extraFields`, `$need_permission`, `$searchable_fields`, `$versioning`, `$write_homepage_map`

### Properties inherited from DataObject

`$allowed_actions`, `$ancestry`, `$api_access`, `$belongs_to`, `$brokenOnDelete`, `$brokenOnWrite`, `$cache_get_one`, `$cache_has_own_table`, `$cache_has_own_table_field`, `$componentCache`, `$components`, `$create_table_options`, `$default_records`, `$destroyed`, `$field_labels`, `$original`, `$plural_name`, `$record`, `$singular_name`

### Properties inherited from ViewableData

`$customisedObject`, `$default_cast`, `$failover`, `$iteratorPos`, `$iteratorTotalItems`

### Properties inherited from Object

`$class`, `$extension_instances`

[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -