Oop Inheritance Dilemma

Sorry, I know this isn’t an OOP forum but I respect the insights of this community and looking for some advice. I’m developing 2 widgets that extend Bootstrap’s TbListView and TbThumbnails respectively. I have a base class (MBaseList) that provides common functionality for both widgets. My first widget, MListView, extends from MBaseList and is working well. The issue is that MThumbnailView needs to extend from MBaseList and also TbThumbnails view. I’ve attached a simple diagram.

The way I see it is that I have 2 options.

[list=1][][size=2]Break Bootstrap’s architecture by making TbThumbnails extend from MBaseList and then my widgets can extend it OR[/size][][size=2]Copy the functionality (very simple actually) from [/size]TbThumbnails [size=2]into MThumbnailView and don’t extend from [/size]TbThumbnails [size=2]anymore[/size][/list]

I’m leaning towards the 2nd option but I’d be interested in any other ideas.




OOP Dilemma.png

Alternatively, create a behavior instead of MBaseList and include it in the two classes.

Doh! I got so involved in the structure I forgot to look at how Yii can help. Thanks!