Important

You are browsing the documentation for version 3.1 of OroCommerce, OroCRM and OroPlatform, which is no longer maintained. Read version 5.1 (the latest LTS version) of the Oro documentation to get up-to-date information.

See our Release Process documentation for more information on the currently supported and upcoming releases.

Entity Configuration

Filename

entity_config.yml

Root Node

entity_config

Sections

Caution

Both the entity and field options must not be used directly under the entity_config key, but a scope key must be used as an intermediate mapping key:

1# src/Acme/DemoBundle/Resources/config/oro/entity_config.yml
2entity_config:
3    demo_scope:
4        # ...

This scope is later referred to with the defaultValues option of the @Config and @ConfigField annotations.

entity

type: map

Options defined under the entity key can be applied on the class level using the @Config annotation. Refer to the field option to define config options that can be applied to individual class properties.

form

type: map

This options can be used to configure some global form options. This is mostly useful for adding custom blocks to the form. This is done with the block_config option which is a map in which the keys are block names and the values are the options that configure the custom blocks:

title (type: string)

The block title which will be passed to the translator before being displayed.

priority (type: integer default: 0)

The block’s priority which is used to control the order in which form blocks are rendered.

items

type: map

The keys of this map are the names of your custom config options. The values for each option are used to control how the options are presented in the UI that lets the modify configuration values:

constraints (type: map)

Validation constraints that must be applied to values that are submitted by the user. Have a look at the validation constraints reference section of the Symfony documentation to see how to set up validation constraints.

form (type: map)

Configures the form field that is used to make the option value configurable:

type (type: string)

A form type name.

options (type: map)

Additional options that will be passed to the form type through the form builder.

grid (type: map)

This map configures how the option will be presented in the data grid views in the entity management interface. Have a look at the columns option of the datagrid configuration reference for all available options.

options (type: map)

Some basic options are grouped under this key:

auditable (type: boolean default: false)

Changes to the option value will be tracked when the field is audited.

indexed (type: boolean default: false)

When enabled, values of this option will be indexed which may increase performance when you query for particular values of the config option.

priority (type: integer)

This controls the order in which fields are rendered when they are modified. Fields with a higher priority are rendered first.

translatable (type: boolean default: false)

By default, the values configured by the user will be treated as is. They will be passed to the translator if the translatable options is enabled.

field

type: map

Under this key, options that are applied on the field level will be configured:

items

type: map

You can use the same options to configure entity fields that you can use when configuring options for an entity class.