I'm trying to get some random products from a DOM, however I want them to only be from currently published pages.
RIght now I have this:
public function getSpecialItems($limit)
{
//DataObject::get($obj, $filter, $sort, $join, $limit);
return DataObject::get("SpecialItem","SpecialHolderID != 5","RAND()","",$limit);
}
Because my SpecialHolder with ID 5 isn't published and I don't want the results to include it. I'd rather this be more automatic and not hard coded. Any thoughts?