0

I have been looking for other users with this symfony 2.1.8 to 2.2.0 upgrade depreciation warning:

set() is deprecated since version 2.1 Access the public property 'vars' instead

I have not been able to find anything in the official documentation, or on the internet at the moment. Is anyone able to give an example using the public property variables?

Wouter J
  • 41,455
  • 15
  • 107
  • 112
Andrew Atkinson
  • 4,103
  • 5
  • 44
  • 48

1 Answers1

1

According to the message, the variable you want to add information is public, so you don't need to use set() function to add value.

Instead of :

$object->set('name', 'value');

Simply use:

$object->vars['name'] = 'value';
j0k
  • 22,600
  • 28
  • 79
  • 90