Your User entity should implement the Dmishh\SettingsBundle\Entity\SettingsOwnerInterface interface. In order to maintain
your user setting you need to implement the getSettingIdentifier to return the username.
class MyUser implements SettingsOwnerInterface
{
// ..
public function getSettingIdentifier()
{
return $this->getUsername();
}
}You do also need to update your database tables.
- Via DoctrineMigrationsBundle:**
php app/console doctrine:migrations:diff
php app/console doctrine:migrations:migrate- Using Doctrine schema update tool
php app/console doctrine:schema:update --force- The following queries should be executed:
DROP INDEX name_user_name_idx ON dmishh_settings;
ALTER TABLE dmishh_settings CHANGE username ownerId VARCHAR(255) DEFAULT NULL;
CREATE INDEX name_owner_id_idx ON dmishh_settings (name, ownerId);The "\Bundle" part of the namespace has been removed between 2.0.0-beta1 and 2.0.0-beta2. The use statements
and AppKernel bundle declaration should be changed:
- Old:
Dmishh\Bundle\SettingsBundle - New:
Dmishh\SettingsBundle