I think dataobject is specified on the has_one relation end, not the
has_many. It would be quite impossible to have a has_many of an
indeterminate class, I think. :) unless I'm remembering my implementation
wrong...
On Mar 17, 2014 7:25 PM, "Simon Welsh" <notifications@github.com> wrote:

> In model/PolymorphicHasManyList.php:
>
> > +		$this->dataQuery->where(sprintf(
> > +			"\"{$this->classForeignKey}\" IN ('%s')",
> > +			implode("', '", $classNames)
> > +		));
> > +	}
> > +	
> > +	/**
> > +	 * Adds the item to this relation.
> > +	 *
> > +	 * It does so by setting the relationFilters.
> > +	 *
> > +	 * @param $item The DataObject to be added, or its ID
> > +	 */
> > +	public function add($item) {
> > +		if(is_numeric($item)) {
> > +			$item = DataObject::get_by_id($this->dataClass, $item);
>
> Isn't $this->dataClass almost always going to be DataObject? So passing
> in an ID doesn't really make sense?
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/silverstripe/silverstripe-framework/pull/2206/files#r10646613>
> .
>