Undefined variable error with protected variable (solved)

Hi, thanks this is helping to avoid the error, and I never read about removing the leading $-sign.
Now the error is gone, but the variable is empty. In the ‘initialize’ the value is available but not in another function of the same class. Do you know why?