src/ORM/UnsavedRelationList.php
public function forForeignID($id)
    {
        $singleton = DataObject::singleton($this->baseClass);
        /** @var Relation $relation */
        $relation = $singleton->{$this->relationName}($id);
        return $relation;
    }
public function forForeignID($id)
    {
        $singleton = DataObject::singleton($this->baseClass);
        /** @var Relation $relation */
        $relation = $singleton->{$this->relationName}($id);
        return $relation;
    }
public function forForeignID ( $ id ) { $ singleton = DataObject :: singleton ( $ this -> baseClass ) ; /** @var Relation $relation */ $ relation = $ singleton -> { $ this -> relationName } ( $ id ) ; return $ relation ; }
Returns a copy of this list with the relationship linked to the given foreign ID.
@param int|array $id An ID or an array of IDs.
@return Relation
Returns a copy of this list with the relationship linked to the given foreign ID .