// always add the criteria fields to the collection, otherwise we have conflicts between criteria.fields and criteria.association logic
$fields = $this->addAssociationFieldsToCriteria($criteria, $definition, $fields);
publicfunctionserialize(Config $config, Field $field, $value): iterable { if(!$field instanceof CustomFields){ thrownew \InvalidArgumentException('Expected field to be an instance of ' . CustomFields::class); }