19declare(strict_types=1);
23use InvalidArgumentException;
38 throw new InvalidArgumentException(
'Associations must not be empty.');
41 array_walk($this->
associations,
static function ($association):
void {
43 throw new InvalidArgumentException(
44 'Associations must be of type ' . Association::class .
'.'
52 if ($association->field()->tableName() !== $first->field()->tableName() ||
53 $association->referenceField()->tableName() !== $first->referenceField()->tableName()
55 throw new InvalidArgumentException(
'All fields must have the same table');
70 return $this->associations;
78 return $this->ignore->values();
83 return $this->
associations[0]->referenceField()->tableName();
__construct(private array $associations, private Ignore $ignore=new Ignore())