@fluentity/core
    Preparing search index...

    Variable BelongsToManyConst

    BelongsToMany: (
        model: () => Constructor<Model<any>>,
        resource?: string,
    ) => PropertyDecoratorType = HasMany

    Alias for HasMany decorator. Used for better semantic meaning in certain relationship contexts.

    Type declaration

      • (model: () => Constructor<Model<any>>, resource?: string): PropertyDecoratorType
      • Decorator for creating a has-many relationship between models. Sets up a one-to-many relationship where a model has multiple related models.

        Parameters

        • model: () => Constructor<Model<any>>

          Factory function that returns the related model constructor

        • Optionalresource: string

          Optional custom resource name for the relation

        Returns PropertyDecoratorType

        A property decorator function

        class User {
        @HasMany(() => Post)
        posts: Post[];
        }
    class User {
    @BelongsToMany(() => Role)
    roles: Role[];
    }