validateSetterIsNotNull example

return $associationViolations;
    }

    /** * @return array<int|string, mixed> */
    private function validateOneToMany(EntityDefinition $definition, OneToManyAssociationField $association): array
    {
        $reference = $association->getReferenceDefinition();

        $associationViolations = $this->validateIsPlural($definition$association);
        $associationViolations = $this->validateSetterIsNotNull($definition$association$associationViolations);

        $reference->getFields()->filter(
            function DField $field) use ($association$definition) {
                if (!$field instanceof ManyToOneAssociationField) {
                    return false;
                }

                return $field->getStorageName() === $association->getReferenceField() && $field->getReferenceDefinition() === $definition;
            }
        )->first();

        
Home | Imprint | This part of the site doesn't use cookies.