Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

ComponentSet::add()


Reply


1234 Views

Avatar
xmedeko

Community Member, 94 Posts

17 July 2007 at 6:28pm

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)