easy_admin:
    entities:
        Users:
            class: App\Entity\Users
            role: ROLE_ADMIN
#            Entity mapping
#            - id
#            - email string 255
#            - username string 255
#            - enabled boolean
#            - datetime lastLogin

            form:
                fields:
                    -
                      property: username
                      label: label.username
                    -
                      property: email
                      label: label.email
                    -
                      property: enabled
                      label: label.enabled
                    -
                      property: 'plainPassword'
                      label: 'label.password'
                      type: 'text'
                      type_options:
                        required: false
                    -
                      property: 'roles'
                      label: 'label.roles'
                      type: 'choice'
                      type_options:
                        multiple: true
                        choices:
                          'ROLE_USER': 'ROLE_USER'
                          'ROLE_ADMIN': 'ROLE_ADMIN'

            list:
                actions: [ '-show' ]
                fields:
                    - id
                    -
                      property: 'email'
                      label: 'label.email'
                    -
                      property: 'username'
                      label: 'label.username'
                    -
                      property: 'enabled'
                      label: 'label.enabled'
                      type: 'toggle'
                    -
                      property: 'lastLogin'
                      label: 'label.lastLogin'
                      type: 'datetime'

            show:
                fields:
                    - id
                    -
                      property: 'username'
                      label: 'label.username'
                    -
                      property: 'email'
                      label: 'label.email'
                    -
                      property: 'enabled'
                      label: 'label.enabled'
                    -
                      property: 'lastLogin'
                      label: 'label.lastLogin'
                    - roles

            edit:
                fields:
                    - { property: 'plainPassword', type_options: { required: false} }
                form_options: { validation_groups: ['Profile'] }
            new:
                fields:
                    - { property: 'plainPassword', type_options: { required: true} }
                form_options: { validation_groups: ['Registration'] }
