Skip to content

Documentation


Documentation / @blazetrails/activerecord / HasManyReflection

Class: HasManyReflection ​

Defined in: packages/activerecord/lib/reflection.ts:949

Extends ​

Constructors ​

Constructor ​

new HasManyReflection(name, scope, options, activeRecord): HasManyReflection

Defined in: packages/activerecord/lib/reflection.ts:513

Parameters ​

ParameterType
namestring | null
scopeScopeBlock | null
optionsRecord<string, unknown>
activeRecordtypeof Base

Returns ​

HasManyReflection

Inherited from ​

AssociationReflection.constructor

Properties ​

activeRecord ​

readonly activeRecord: typeof Base

Defined in: packages/activerecord/lib/reflection.ts:383

Inherited from ​

AssociationReflection.activeRecord


name ​

readonly name: string

Defined in: packages/activerecord/lib/reflection.ts:381

Inherited from ​

AssociationReflection.name


options ​

readonly options: Record<string, unknown>

Defined in: packages/activerecord/lib/reflection.ts:382

Inherited from ​

AssociationReflection.options


parentReflection ​

parentReflection: AssociationReflection | ThroughReflection | null = null

Defined in: packages/activerecord/lib/reflection.ts:509

Inherited from ​

AssociationReflection.parentReflection


pluralName ​

readonly pluralName: string

Defined in: packages/activerecord/lib/reflection.ts:384

Inherited from ​

AssociationReflection.pluralName

Accessors ​

activeRecordPrimaryKey ​

Get Signature ​

get activeRecordPrimaryKey(): string | string[]

Defined in: packages/activerecord/lib/reflection.ts:764

Returns ​

string | string[]

Inherited from ​

AssociationReflection.activeRecordPrimaryKey


associationForeignKey ​

Get Signature ​

get associationForeignKey(): string

Defined in: packages/activerecord/lib/reflection.ts:741

Returns ​

string

Inherited from ​

AssociationReflection.associationForeignKey


autosave ​

Set Signature ​

set autosave(value): void

Defined in: packages/activerecord/lib/reflection.ts:416

Parameters ​
ParameterType
valueboolean
Returns ​

void

Inherited from ​

AssociationReflection.autosave


chain ​

Get Signature ​

get chain(): AbstractReflection[]

Defined in: packages/activerecord/lib/reflection.ts:177

Returns ​

AbstractReflection[]

Inherited from ​

AssociationReflection.chain


className ​

Get Signature ​

get className(): string

Defined in: packages/activerecord/lib/reflection.ts:132

Returns ​

string

Inherited from ​

AssociationReflection.className


foreignType ​

Get Signature ​

get foreignType(): string | null

Defined in: packages/activerecord/lib/reflection.ts:617

Returns ​

string | null

Inherited from ​

AssociationReflection.foreignType


joinForeignKey ​

Get Signature ​

get joinForeignKey(): string | string[]

Defined in: packages/activerecord/lib/reflection.ts:760

Returns ​

string | string[]

Inherited from ​

AssociationReflection.joinForeignKey


joinPrimaryType ​

Get Signature ​

get joinPrimaryType(): string | null

Defined in: packages/activerecord/lib/reflection.ts:756

Returns ​

string | null

Inherited from ​

AssociationReflection.joinPrimaryType


joinTable ​

Get Signature ​

get joinTable(): string

Defined in: packages/activerecord/lib/reflection.ts:632

Returns ​

string

Inherited from ​

AssociationReflection.joinTable


klass ​

Get Signature ​

get klass(): typeof Base

Defined in: packages/activerecord/lib/reflection.ts:432

Returns ​

typeof Base

Inherited from ​

AssociationReflection.klass


macro ​

Get Signature ​

get macro(): MacroType

Defined in: packages/activerecord/lib/reflection.ts:950

Returns ​

MacroType

Overrides ​

AssociationReflection.macro


nameString ​

Get Signature ​

get protected nameString(): string

Defined in: packages/activerecord/lib/reflection.ts:402

Returns ​

string

Inherited from ​

AssociationReflection.nameString


scope ​

Get Signature ​

get scope(): ScopeBlock | null

Defined in: packages/activerecord/lib/reflection.ts:428

Returns ​

ScopeBlock | null

Inherited from ​

AssociationReflection.scope


scopes ​

Get Signature ​

get scopes(): ScopeBlock[]

Defined in: packages/activerecord/lib/reflection.ts:141

Returns ​

ScopeBlock[]

Inherited from ​

AssociationReflection.scopes


sourceReflection ​

Get Signature ​

get sourceReflection(): this

Defined in: packages/activerecord/lib/reflection.ts:834

Returns ​

this

Inherited from ​

AssociationReflection.sourceReflection


strictLoading ​

Get Signature ​

get strictLoading(): boolean

Defined in: packages/activerecord/lib/reflection.ts:932

Returns ​

boolean

Inherited from ​

AssociationReflection.strictLoading


tableName ​

Get Signature ​

get tableName(): string | null

Defined in: packages/activerecord/lib/reflection.ts:121

Returns ​

string | null

Inherited from ​

AssociationReflection.tableName


throughReflection ​

Get Signature ​

get throughReflection(): null

Defined in: packages/activerecord/lib/reflection.ts:830

Returns ​

null

Inherited from ​

AssociationReflection.throughReflection


type ​

Get Signature ​

get type(): string | null

Defined in: packages/activerecord/lib/reflection.ts:748

Returns ​

string | null

Inherited from ​

AssociationReflection.type

Methods ​

_klass() ​

_klass(className): typeof Base

Defined in: packages/activerecord/lib/reflection.ts:441

Parameters ​

ParameterType
classNamestring

Returns ​

typeof Base

Inherited from ​

AssociationReflection._klass


addAsPolymorphicThrough() ​

addAsPolymorphicThrough(reflection, seed): AbstractReflection[]

Defined in: packages/activerecord/lib/reflection.ts:885

Parameters ​

ParameterType
reflectionAssociationReflection | ThroughReflection
seedAbstractReflection[]

Returns ​

AbstractReflection[]

Inherited from ​

AssociationReflection.addAsPolymorphicThrough


addAsSource() ​

addAsSource(seed): AbstractReflection[]

Defined in: packages/activerecord/lib/reflection.ts:881

Parameters ​

ParameterType
seedAbstractReflection[]

Returns ​

AbstractReflection[]

Inherited from ​

AssociationReflection.addAsSource


addAsThrough() ​

addAsThrough(seed): AbstractReflection[]

Defined in: packages/activerecord/lib/reflection.ts:892

Parameters ​

ParameterType
seedAbstractReflection[]

Returns ​

AbstractReflection[]

Inherited from ​

AssociationReflection.addAsThrough


aliasCandidate() ​

aliasCandidate(name): string

Defined in: packages/activerecord/lib/reflection.ts:344

Parameters ​

ParameterType
namestring

Returns ​

string

Inherited from ​

AssociationReflection.aliasCandidate


associationClass() ​

associationClass(): typeof HasManyThroughAssociation | typeof HasManyAssociation

Defined in: packages/activerecord/lib/reflection.ts:958

Returns ​

typeof HasManyThroughAssociation | typeof HasManyAssociation

Overrides ​

AssociationReflection.associationClass


associationPrimaryKey() ​

associationPrimaryKey(klass?): string | string[]

Defined in: packages/activerecord/lib/reflection.ts:737

Parameters ​

ParameterType
klass?typeof Base

Returns ​

string | string[]

Inherited from ​

AssociationReflection.associationPrimaryKey


associationScopeCache() ​

associationScopeCache(klass, owner, block): any

Defined in: packages/activerecord/lib/reflection.ts:785

Parameters ​

ParameterType
klasstypeof Base
ownerBase
block(params) => any

Returns ​

any

Inherited from ​

AssociationReflection.associationScopeCache


belongsTo() ​

belongsTo(): boolean

Defined in: packages/activerecord/lib/reflection.ts:153

Returns ​

boolean

Inherited from ​

AssociationReflection.belongsTo


buildAssociation() ​

buildAssociation(attributes?, block?): Base

Defined in: packages/activerecord/lib/reflection.ts:125

Parameters ​

ParameterType
attributesRecord<string, unknown> | Map<string, unknown> | PermittedAttributes
block?(record) => void

Returns ​

Base

Inherited from ​

AssociationReflection.buildAssociation


buildScope() ​

buildScope(table?, predicateBuilder?, klass?): any

Defined in: packages/activerecord/lib/reflection.ts:185

Parameters ​

ParameterType
table?Table | TableAlias
predicateBuilder?PredicateBuilder
klass?typeof Base

Returns ​

any

Inherited from ​

AssociationReflection.buildScope


canFindInverseOfAutomatically() ​

protected canFindInverseOfAutomatically(reflection, inverseReflection?): boolean

Defined in: packages/activerecord/lib/reflection.ts:715

Parameters ​

ParameterTypeDefault value
reflectionAssociationReflection | ThroughReflectionundefined
inverseReflectionbooleanfalse

Returns ​

boolean

Inherited from ​

AssociationReflection.canFindInverseOfAutomatically


checkEagerLoadableBang() ​

checkEagerLoadableBang(): void

Defined in: packages/activerecord/lib/reflection.ts:815

Returns ​

void

Inherited from ​

AssociationReflection.checkEagerLoadableBang


checkValidityBang() ​

checkValidityBang(): void

Defined in: packages/activerecord/lib/reflection.ts:795

Returns ​

void

Inherited from ​

AssociationReflection.checkValidityBang


checkValidityOfInverseBang() ​

checkValidityOfInverseBang(): void

Defined in: packages/activerecord/lib/reflection.ts:271

Returns ​

void

Inherited from ​

AssociationReflection.checkValidityOfInverseBang


clearAssociationScopeCache() ​

clearAssociationScopeCache(): void

Defined in: packages/activerecord/lib/reflection.ts:842

Returns ​

void

Inherited from ​

AssociationReflection.clearAssociationScopeCache


collectJoinChain() ​

collectJoinChain(): AbstractReflection[]

Defined in: packages/activerecord/lib/reflection.ts:838

Returns ​

AbstractReflection[]

Inherited from ​

AssociationReflection.collectJoinChain


computeClass() ​

computeClass(name): typeof Base

Defined in: packages/activerecord/lib/reflection.ts:902

Parameters ​

ParameterType
namestring

Returns ​

typeof Base

Inherited from ​

AssociationReflection.computeClass


constraints() ​

constraints(): ScopeBlock[]

Defined in: packages/activerecord/lib/reflection.ts:247

Returns ​

ScopeBlock[]

Inherited from ​

AssociationReflection.constraints


counterCacheColumn() ​

counterCacheColumn(): string | null

Defined in: packages/activerecord/lib/reflection.ts:251

Returns ​

string | null

Inherited from ​

AssociationReflection.counterCacheColumn


equals() ​

equals(other): boolean

Defined in: packages/activerecord/lib/reflection.ts:406

Parameters ​

ParameterType
otherunknown

Returns ​

boolean

Inherited from ​

AssociationReflection.equals


extensions() ​

extensions(): any[]

Defined in: packages/activerecord/lib/reflection.ts:896

Returns ​

any[]

Inherited from ​

AssociationReflection.extensions


foreignKey() ​

foreignKey(__namedParameters?): string | string[]

Defined in: packages/activerecord/lib/reflection.ts:539

Parameters ​

ParameterType
__namedParameters{ inferFromInverseOf?: boolean; }
__namedParameters.inferFromInverseOf?boolean

Returns ​

string | string[]

Inherited from ​

AssociationReflection.foreignKey


hasActiveCachedCounter() ​

hasActiveCachedCounter(): boolean

Defined in: packages/activerecord/lib/reflection.ts:328

Returns ​

boolean

Inherited from ​

AssociationReflection.hasActiveCachedCounter


hasCachedCounter() ​

hasCachedCounter(): boolean

Defined in: packages/activerecord/lib/reflection.ts:319

Returns ​

boolean

Inherited from ​

AssociationReflection.hasCachedCounter


hasInverse() ​

hasInverse(): string | false | null

Defined in: packages/activerecord/lib/reflection.ts:647

Returns ​

string | false | null

Inherited from ​

AssociationReflection.hasInverse


hasOne() ​

hasOne(): boolean

Defined in: packages/activerecord/lib/reflection.ts:161

Returns ​

boolean

Inherited from ​

AssociationReflection.hasOne


hasScope() ​

hasScope(): boolean

Defined in: packages/activerecord/lib/reflection.ts:848

Returns ​

boolean

Inherited from ​

AssociationReflection.hasScope


inverseOf() ​

inverseOf(): AssociationReflection | ThroughReflection | null

Defined in: packages/activerecord/lib/reflection.ts:651

Returns ​

AssociationReflection | ThroughReflection | null

Inherited from ​

AssociationReflection.inverseOf


inverseWhichUpdatesCounterCache() ​

inverseWhichUpdatesCounterCache(): AbstractReflection | null

Defined in: packages/activerecord/lib/reflection.ts:287

Returns ​

AbstractReflection | null

Inherited from ​

AssociationReflection.inverseWhichUpdatesCounterCache


isBelongsTo() ​

isBelongsTo(): boolean

Defined in: packages/activerecord/lib/reflection.ts:157

Returns ​

boolean

Inherited from ​

AssociationReflection.isBelongsTo


isCollection() ​

isCollection(): boolean

Defined in: packages/activerecord/lib/reflection.ts:954

Returns ​

boolean

Overrides ​

AssociationReflection.isCollection


isCounterMustBeUpdatedByHasMany() ​

isCounterMustBeUpdatedByHasMany(): boolean

Defined in: packages/activerecord/lib/reflection.ts:340

Returns ​

boolean

Inherited from ​

AssociationReflection.isCounterMustBeUpdatedByHasMany


isHasOne() ​

isHasOne(): boolean

Defined in: packages/activerecord/lib/reflection.ts:165

Returns ​

boolean

Inherited from ​

AssociationReflection.isHasOne


isInverseUpdatesCounterCache() ​

isInverseUpdatesCounterCache(): AbstractReflection | null

Defined in: packages/activerecord/lib/reflection.ts:304

Returns ​

AbstractReflection | null

Inherited from ​

AssociationReflection.isInverseUpdatesCounterCache


isInverseUpdatesCounterInMemory() ​

isInverseUpdatesCounterInMemory(): boolean

Defined in: packages/activerecord/lib/reflection.ts:308

Returns ​

boolean

Inherited from ​

AssociationReflection.isInverseUpdatesCounterInMemory


isNested() ​

isNested(): boolean

Defined in: packages/activerecord/lib/reflection.ts:844

Returns ​

boolean

Inherited from ​

AssociationReflection.isNested


isPolymorphic() ​

isPolymorphic(): boolean

Defined in: packages/activerecord/lib/reflection.ts:637

Returns ​

boolean

Inherited from ​

AssociationReflection.isPolymorphic


isThroughReflection() ​

isThroughReflection(): boolean

Defined in: packages/activerecord/lib/reflection.ts:111

Returns ​

boolean

Inherited from ​

AssociationReflection.isThroughReflection


isValidate() ​

isValidate(): boolean

Defined in: packages/activerecord/lib/reflection.ts:641

Returns ​

boolean

Inherited from ​

AssociationReflection.isValidate


joinIdFor() ​

joinIdFor(owner): any[]

Defined in: packages/activerecord/lib/reflection.ts:825

Parameters ​

ParameterType
ownerBase

Returns ​

any[]

Inherited from ​

AssociationReflection.joinIdFor


joinPrimaryKey() ​

joinPrimaryKey(_klass?): string | string[]

Defined in: packages/activerecord/lib/reflection.ts:752

Parameters ​

ParameterType
_klass?typeof Base

Returns ​

string | string[]

Inherited from ​

AssociationReflection.joinPrimaryKey


joinScope() ​

joinScope(table, foreignTable, foreignKlass): any

Defined in: packages/activerecord/lib/reflection.ts:193

Parameters ​

ParameterType
tableTable | TableAlias
foreignTableTable | TableAlias
foreignKlasstypeof Base

Returns ​

any

Inherited from ​

AssociationReflection.joinScope


joinScopes() ​

joinScopes(table, predicateBuilder?, klass?, record?): any[]

Defined in: packages/activerecord/lib/reflection.ts:230

Parameters ​

ParameterType
tableTable | TableAlias
predicateBuilder?PredicateBuilder
klass?typeof Base
record?Base

Returns ​

any[]

Inherited from ​

AssociationReflection.joinScopes


klassJoinScope() ​

klassJoinScope(table?, predicateBuilder?): any

Defined in: packages/activerecord/lib/reflection.ts:242

Parameters ​

ParameterType
table?Table | TableAlias
predicateBuilder?PredicateBuilder

Returns ​

any

Inherited from ​

AssociationReflection.klassJoinScope


polymorphicInverseOf() ​

polymorphicInverseOf(associatedClass): AssociationReflection | ThroughReflection | null

Defined in: packages/activerecord/lib/reflection.ts:852

Parameters ​

ParameterType
associatedClasstypeof Base

Returns ​

AssociationReflection | ThroughReflection | null

Inherited from ​

AssociationReflection.polymorphicInverseOf


polymorphicName() ​

polymorphicName(): string

Defined in: packages/activerecord/lib/reflection.ts:877

Returns ​

string

Inherited from ​

AssociationReflection.polymorphicName


primaryKey() ​

protected primaryKey(klass): string | string[]

Defined in: packages/activerecord/lib/reflection.ts:115

Parameters ​

ParameterType
klasstypeof Base

Returns ​

string | string[]

Inherited from ​

AssociationReflection.primaryKey


scopeFor() ​

scopeFor(relation, owner?): any

Defined in: packages/activerecord/lib/reflection.ts:457

Parameters ​

ParameterTypeDefault value
relationanyundefined
owneranynull

Returns ​

any

Inherited from ​

AssociationReflection.scopeFor


strictLoadingViolationMessage() ​

strictLoadingViolationMessage(owner): string

Defined in: packages/activerecord/lib/reflection.ts:348

Parameters ​

ParameterType
ownerunknown

Returns ​

string

Inherited from ​

AssociationReflection.strictLoadingViolationMessage