I have a class XEHotel, which is a subclass of XEProduct. I am trying ComponentSet::add($XEHotel) and got such error:
user_error(ComponentSet::add() Tried to add an 'XEHotel' object, but 'XEProduct' expected,256)
line 93 of ComponentSet.php
I had a look into ComponentSet.php and see the comment:
// TODO Should this allow subclasses?
I think, it definitely should. I know, that I can always use ComponentSet::add($XEHotel->ID)