new ManyToManyRelationship()
Properties:
Name | Type | Description |
---|---|---|
name |
string | The relationship name |
type |
string | The relationship type |
hasApi |
boolean | Determines if it has API |
modelKey |
Field | The model key field |
localModelKey |
Field | The local model key field |
model |
Entity | Related model from this relationship |
pivot |
Entity | The pivot from this relationship |
localModel |
Entity | Local model from this relationship |
components |
ManyToManyComponent | The relationship components |
inverse |
ManyToManyRelationship | The inverse relationship |
Methods
getApiRoutes() → {array}
Returns the relationship api routes
Returns:
- Type
- array
getControllerName() → {string}
Returns the controller name
Returns:
- Type
- string
getDefaultKeys() → {object}
Returns the relationship keys
Returns:
- Type
- object
getDefaultKeysNames() → {object}
Returns the default keys names (Local Model Key and Related Model Key)
Returns:
- Type
- object
getDefaultLocalModelKeyName() → {string}
Returns the local model default key name
Returns:
- Type
- string
getDefaultModelKeyName() → {string}
Returns the model default key name
Returns:
- Type
- string
getDefaultPivotName() → {string}
Returns the default pivot name
Returns:
- Type
- string
hasDifferentLocalModelKey() → {boolean}
Check if it has a different local model key name
Returns:
- Type
- boolean
hasDifferentLocalOrRelatedModelKeys() → {boolean}
Check if it has a different local model key or different model key
Returns:
- Type
- boolean
hasDifferentModelKey() → {boolean}
Check if it has a different model key name
Returns:
- Type
- boolean
hasDifferentPivot() → {boolean}
Check if it has a different pivot name
Returns:
- Type
- boolean
needsToAddPivotToModelTemplate() → {boolean}
Check if this relationship need a pivot model in the template
Returns:
- Type
- boolean