Have BelongsToMany inherit constraints from relationship query (Issue #5589)

Allows me to turn this
```php
$optionalItems = $basket->items(Item::TYPE_OPTIONAL);
$existingIds = $optionalItems->get()->fetch('id')->toArray();
if (count($existingIds)) {
	if (count($existingIds) === 1) {
		$existingIds = reset($existingIds);
	} else {
		$existingIds = array_unique($existingIds);
	}
	$optionalItems->detach($existingIds);
}
$optionalItems->attach(Input::get('items-optional'), ['relationship' => Item::TYPE_OPTIONAL]);
```
into this:
```php
$optionalItems = $basket->items(Item::TYPE_OPTIONAL);
$optionalItems->sync(Input::get('items-optional'));
```