Closed AVATOR closed 7 years ago
I don't think that settings may be dynamic. If you need with concrete setting, than create it. I supposed that settings will use as static rarely changed values.
How do you plan to use settings so that it can be null?
I work with Magento and it return "" if setting can not find. Example: I create setting "heder_phone". Web-site will stop work if manager accidentally deleted a setting.
It's really bug. I will fix soon.
You can configure SonataAdminBundle that manager can't delete setting (superadmin can everything):
# app/config/config.yml
sonata_admin:
security:
handler: sonata.admin.security.handler.role
# app/config/security.yml
security:
role_hierarchy:
ROLE_SONATA_MANAGER:
- ROLE_APP_ADMIN_ARTICLE_ALL
- ROLE_LEXXPAVLOV_SONATA_ADMIN_SETTINGS_LIST
- ROLE_LEXXPAVLOV_SONATA_ADMIN_SETTINGS_EDIT
- ROLE_LEXXPAVLOV_SONATA_ADMIN_SETTINGS_SHOW
# - ROLE_APP_ADMIN_USER_ALL
ROLE_ADMIN: [ ROLE_USER, ROLE_SONATA_ADMIN ]
ROLE_MANAGER: [ ROLE_ADMIN, ROLE_SONATA_MANAGER ]
ROLE_SUPER_ADMIN: [ ROLE_MANAGER, ROLE_ALLOWED_TO_SWITCH ]
See security docs.
I have created pull request https://github.com/lexxpavlov/LexxpavlovSettingsBundle/pull/5
Hi. I try to get data by "name" which doesn't exist and get error
Error: Call to a member function getValue() on null
Please, return "" if settings don't exist.