ludak
Active member
This might be a newbie question but just reading though the documentation and trying to grasp the listeners concept. I have extensive development skills, just not in php and started playing with php just few days ago as we needed some add-ons for our community. Maybe some of the concepts are different and maybe I am just overthinking the listeners, but here is what I am wondering.
Are the listeners really suppose to be used when we are changing the default xenforo entities? For example, I would like my add-on to have additional information in User Entity. So I want to add a column into the xf_user table called my_addon_new_column.
Then I would have to create a listener in order to extent the User structure and have the column available to me in the code? Am I getting this correctly?
Another question would be, if I did not change the User table, but just created a new table for my addon that has a foreign key to the UserID, so that I can access the user that way, would I really then need a listener anymore? I am guessing no, since I am creating the new entity, I can just extend from \XF\Mvc\Entity\Entity ?
Sorry for the newbie questions, just trying to grasp the ideas before writing more complex stuff out. I like to be on the right path so that I have better code structure and coding standards used, for easier maintnance.
Thanks
Are the listeners really suppose to be used when we are changing the default xenforo entities? For example, I would like my add-on to have additional information in User Entity. So I want to add a column into the xf_user table called my_addon_new_column.
Then I would have to create a listener in order to extent the User structure and have the column available to me in the code? Am I getting this correctly?
Another question would be, if I did not change the User table, but just created a new table for my addon that has a foreign key to the UserID, so that I can access the user that way, would I really then need a listener anymore? I am guessing no, since I am creating the new entity, I can just extend from \XF\Mvc\Entity\Entity ?
Sorry for the newbie questions, just trying to grasp the ideas before writing more complex stuff out. I like to be on the right path so that I have better code structure and coding standards used, for easier maintnance.
Thanks