```php
class HomePage extends Page
{
private static $many_many = [
'HeroImages' => [
'through' => PageImageLink::class,
'from' => 'Page',
'to' => 'Image',
]
];
}
```
```php
class PageImageLink extends DataObject
{
private static $has_one = [
'Page' => SiteTree::class,
'Image' => Image::class,
];
}
This fails because the linking object's relation class doesn't exactly match the owner. Sharing the linking objects across various entries in the ancestry should be a supported use case.
Co-authored-by: Aaron Carlino <unclecheese@leftandmain.com>
Instead of just setting one side of the relation to null in the through
list, remove the rows entirely.
Remove only the relations which match the filters that have already been
set on the list.
This is consistent with the way ManyManyList works.
Also some small tidy-up (removing an unnecessary line break and an
unused "use" statement)
* BUGFIX many many through not sorting by join table
* #8534 added docs to support many many sorting fix
* #8534 added test cases for many_many default sorting
* API Support many_many through polymorphic relations (from side only)
Fixes#7911Fixes#3136
* Add extra docs and allow optional arguments
* ENHANCEMENT Enable quiet to be turned off
* BUG Fix issue with manymanythroughlist duplication