Extending the child class works, but extending its parent class does not

Marcus

Well-known member
When I extend XenForo_DataWriter_Forum and increase the title length it works great.

However my first idea was to only extend the parent class XenForo_DataWriter_Node and increase the title length there. But that does not work, instead I get the "please restrict your title length to 50 characters" message when saving a forum with a larger title.

It would help my understanding of XenForos Class System greatly if I figure out why it works how it works.
 
The dynamic proxy system, by design, doesn't let you extend the parent class. You can only extend leaf classes in the class hierarchies
 
As far as I know this is nearly impossible to do and have it work for all node types that are created by add-ons. Hopefully it's something they address with XenForo 2.0.
 
  • Like
Reactions: Xon
It's the way the class proxy is designed. It takes the class, and all proxies extend other proxies until the final proxy extends the main class.

While I'm guessing extending parents could be implemented, it wouldn't be nice and would probably lead to confusion...
 
Top Bottom