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.

@Config

This annotation is used to configure default values for configurable entity classes.

Options

defaultValues

Configures default values for particular config options on a per property basis:

 1// ...
 2use Oro\Bundle\EntityConfigBundle\Metadata\Annotation\Config;
 3
 4/**
 5 * @Config(
 6 *      defaultValues={
 7 *          "dataaudit"={
 8 *              "auditable"=true
 9 *          }
10 *      }
11 * )
12 */
13class User
14{
15    // ...
16}

This example sets the auditable option from the dataaudit scope to true for the User class.

routeName

The route name of view that shows the datagrid of available records:

 1// ...
 2use Oro\Bundle\EntityConfigBundle\Metadata\Annotation\Config;
 3
 4/**
 5 * @Config(
 6 *      routeName="oro_user_index"
 7 * )
 8 */
 9class User
10{
11    // ...
12}

routeView

The route name of a controller that shows a particular object:

 1// ...
 2use Oro\Bundle\EntityConfigBundle\Metadata\Annotation\Config;
 3
 4/**
 5 * @Config(
 6 *      routeView="oro_user_view"
 7 * )
 8 */
 9class User
10{
11    // ...
12}

routeCreate

The route name of a controller that creates an object:

 1    // ...
 2    use Oro\Bundle\EntityConfigBundle\Metadata\Annotation\Config;
 3
 4    /**
 5     * @Config(
 6     *      routeCreate="oro_user_create"
 7     * )
 8     */
 9    class User
10    {
11        // ...
12    }

routeUpdate

The route name of controller action that updates an object:

 1        // ...
 2        use Oro\Bundle\EntityConfigBundle\Metadata\Annotation\Config;
 3
 4        /**
 5         * @Config(
 6         *      routeUpdate="oro_user_update"
 7         * )
 8         */
 9        class User
10        {
11            // ...
12        }