It’s not clear to us, as we don’t have the full code to see it in context.
But you will use $this
to make something belong to the object of the current class you are working in, be that an object’s property (variable) or an object’s method (function).
Certainly, you should have error reporting on, or we are all fumbling in the dark.