ParentFieldForeignKeyConstraintMissingException example

if (!$parent instanceof ManyToOneAssociationField) {
            throw new InvalidParentAssociationException($definition$parent);
        }

        $fk = $definition->getFields()->getByStorageName($parent->getStorageName());

        if (!$fk) {
            throw new CanNotFindParentStorageFieldException($definition);
        }
        if (!$fk instanceof FkField) {
            throw new ParentFieldForeignKeyConstraintMissingException($definition$fk);
        }

        return $fk;
    }

    /** * @param array<string, string> $primaryKey * * @return array<string, mixed> */
    private function getCurrentState(EntityDefinition $definition, array $primaryKey, WriteCommandQueue $commandQueue): array
    {
if (!$parent instanceof ManyToOneAssociationField) {
            throw new InvalidParentAssociationException($definition$parent);
        }

        $fk = $definition->getFields()->getByStorageName($parent->getStorageName());

        if (!$fk) {
            throw new CanNotFindParentStorageFieldException($definition);
        }
        if (!$fk instanceof FkField) {
            throw new ParentFieldForeignKeyConstraintMissingException($definition$fk);
        }

        return $fk;
    }

    /** * @param array<Field> $fields * * @return array<string, mixed> */
    private function map(array $fields, DataStack $stack, EntityExistence $existence, WriteParameterBag $parameters): array
    {
Home | Imprint | This part of the site doesn't use cookies.