-
Backend
-
Behaviors
-
FormController
-
ImportExportController
-
ListController
-
RelationController
- FormController
- ImportExportController
- ListController
- RelationController
- ReorderController
- UserPreferencesModel
-
-
Classes
-
Dashboard
-
NavigationManager
-
WidgetManager
- AuthManager
- BackendController
- Controller
- ControllerBehavior
- DashboardManager
- DashboardWidgetBase
- FilterScope
- FilterWidgetBase
- FormField
- FormTabs
- FormWidgetBase
- ListColumn
- LoginCustomization
- MainMenuItem
- NavigationManager
- ReportDataSourceBase
- ReportDataSourceManager
- ReportWidgetBase
- RoleManager
- RolePermission
- SettingsController
- SideMenuItem
- Skin
- StaticReportWidgetContainer
- VueComponentBase
- WidgetBase
- WidgetManager
- WildcardController
-
-
Controllers
-
Database
-
Facades
-
FilterWidgets
-
FormWidgets
-
Helpers
-
Models
-
BrandSetting
-
ExportModel
-
ImportModel
- AccessLog
- BrandSetting
- Dashboard
- EditorSetting
- ExportModel
- ImportModel
- Preference
- ReportDataCache
- User
- UserGroup
- UserPreference
- UserPreferenceModel
- UserRole
- UserThrottle
-
-
ReportWidgets
-
Skins
-
Traits
-
VueComponents
-
Widgets
-
Filter
-
Form
-
Lists
-
Table
- Filter
- Form
- Lists
- ListStructure
- ReportContainer
- RoleImpersonator
- Search
- SiteSwitcher
- Table
- Toolbar
-
- ServiceProvider
-
-
Cms
-
Classes
-
Controller
-
EditorExtension
-
Layout
-
Page
-
Partial
-
Theme
- AjaxResponse
- Asset
- CmsCompoundObject
- CmsController
- CmsDemoTrafficDataGenerator
- CmsException
- CmsObject
- CmsObjectCache
- CmsObjectCollection
- CmsReportDataSource
- CmsStatusDataSource
- CodeBase
- CodeParser
- ComponentBase
- ComponentBehavior
- ComponentHelpers
- ComponentManager
- ComponentModuleBase
- ComponentPartial
- Content
- Controller
- EditorExtension
- Layout
- LayoutCode
- Meta
- Page
- PageCode
- PageManager
- Partial
- PartialCode
- PartialStack
- PartialWatcher
- Router
- Snippet
- SnippetManager
- Theme
- ThemeManager
- ThisVariable
- TrafficLogger
-
-
Components
-
Console
-
Controllers
-
Database
-
Facades
-
FormWidgets
-
Helpers
-
Models
-
ReportWidgets
-
Traits
-
Twig
- AjaxPartialTokenParser
- ComponentNode
- ComponentTokenParser
- ContentNode
- ContentTokenParser
- DebugExtension
- DefaultNode
- DefaultTokenParser
- Extension
- FlashNode
- FlashTokenParser
- FrameworkNode
- FrameworkTokenParser
- GetAttrAdjuster
- GetAttrNode
- Loader
- MetaNode
- MetaTokenParser
- PageNode
- PageTokenParser
- PartialNode
- PartialTokenParser
- PlaceholderNode
- PlaceholderTokenParser
- PutNode
- PutTokenParser
- ScriptsNode
- ScriptsTokenParser
- StylesNode
- StylesTokenParser
-
VueComponents
-
Widgets
- ServiceProvider
-
-
Editor
-
Behaviors
-
Classes
-
Controllers
-
Traits
-
VueComponents
- ServiceProvider
-
-
Media
-
Classes
-
Controllers
-
FormWidgets
-
Helpers
-
Twig
-
Widgets
- ServiceProvider
-
-
System
-
Behaviors
-
Classes
-
PresetManager
-
SiteManager
-
UiManager
-
UpdateManager
- AppBase
- CombineAssets
- DependencyResolver
- DriverBehavior
- ErrorHandler
- MailManager
- ManifestCache
- MarkupExtensionItem
- MarkupManager
- ModelBehavior
- PagerElement
- PluginBase
- PluginManager
- PresetManager
- ProductDetail
- RateLimiter
- ResizeImageItem
- ResizeImages
- SettingsManager
- SettingsMenuItem
- SiteManager
- SystemController
- SystemReportDataSource
- UiElement
- UiManager
- UpdateManager
- VersionManager
-
-
Console
- ComposerScript
- OctoberAbout
- OctoberDown
- OctoberFresh
- OctoberMigrate
- OctoberMirror
- OctoberOptimize
- OctoberPasswd
- OctoberUp
- OctoberUpdate
- OctoberUtil
- OctoberUtilCommands
- OctoberUtilPatches
- OctoberUtilRefitLang
- PluginCheck
- PluginDisable
- PluginEnable
- PluginInstall
- PluginList
- PluginRefresh
- PluginRemove
- PluginSeed
- PluginTest
- ProjectSync
-
Controllers
-
Database
-
Facades
-
Helpers
-
Middleware
-
Models
-
ReportWidgets
-
Traits
-
Twig
-
Widgets
- ServiceProvider
-
-
Tailor
-
Behaviors
-
Classes
-
Blueprint
-
BlueprintIndexer
-
EditorExtension
-
Relations
-
SchemaBuilder
-
Scopes
- Blueprint
- BlueprintCollection
- BlueprintErrorData
- BlueprintException
- BlueprintIndexer
- BlueprintModel
- BlueprintVerifier
- ComponentVariable
- ContentFieldBase
- EditorExtension
- FieldManager
- Fieldset
- NavigationItem
- PermissionItem
- RecordIndexer
- SchemaBuilder
- SchemaPruner
-
-
Components
-
Console
-
ContentFields
-
Controllers
-
Models
-
EntryRecord
-
GlobalRecord
-
RecordImport
- ContentSchema
- EntryRecord
- GlobalRecord
- NestedFormItem
- PreviewToken
- RecordExport
- RecordImport
- RepeaterItem
-
-
Traits
-
VueComponents
- ServiceProvider
-
-
Events
-
backend
-
ajax
-
brand
-
files
-
filter
-
form
-
list
-
menu
-
page
-
roles
-
site
-
user
-
-
cms
-
ajax
-
block
-
combiner
-
component
-
internalTrafficStatistics
-
object
-
page
-
pageLookup
-
resizer
-
router
-
sitePicker
-
template
-
theme
- extendTwig
-
-
deferredBinding
-
editor
-
extension
-
-
exception
-
halcyon
-
datasource
-
-
mailer
-
media
-
model
-
auth
-
filter
-
form
-
relation
-
/docs/api/model/relation/add
-
/docs/api/model/relation/associate
- attach
-
/docs/api/model/relation/beforeadd
-
/docs/api/model/relation/beforeassociate
- beforeAttach
- beforeDetach
-
/docs/api/model/relation/beforedissociate
-
/docs/api/model/relation/beforeremove
- detach
-
/docs/api/model/relation/dissociate
-
/docs/api/model/relation/remove
-
-
/docs/api/model/afterboot
-
/docs/api/model/aftercreate
-
/docs/api/model/afterdelete
-
/docs/api/model/afterfetch
-
/docs/api/model/afterinit
- afterRelation
- afterRestore
-
/docs/api/model/aftersave
- afterTrash
-
/docs/api/model/afterupdate
- afterValidate
-
/docs/api/model/beforecreate
-
/docs/api/model/beforedelete
-
/docs/api/model/beforefetch
- beforeGetAttribute
- beforeRelation
- beforeReplicate
- beforeRestore
-
/docs/api/model/beforesave
- beforeSetAttribute
-
/docs/api/model/beforeupdate
- beforeValidate
- extendBlueprint
- getAttribute
- newInstance
- saveInternal
- setAttribute
-
-
pages
-
snippet
-
-
site
-
system
-
assets
- beforeAddAsset
-
/docs/api/system/assets/beforebundleasset
-
console
-
mirror
-
-
mail
-
reportwidgets
-
resizer
-
settings
-
site
-
updater
- extendConfigFile
- extendTwig
-
-
tailor
-
user
-
-
Library
-
Argon
-
Assetic
-
Asset
-
Cache
-
Exception
-
Factory
-
Filter
-
Traits
-
Util
- README
- AsseticServiceProvider
- AssetManager
- AssetWriter
- Combiner
- FilterManager
-
-
Auth
-
Combine
-
Composer
-
Config
-
Database
-
Attach
-
Concerns
-
Connections
-
Connectors
-
Factories
-
Models
-
Relations
-
Schema
-
Scopes
-
Traits
-
Updates
- README
- Builder
- Collection
- DatabaseServiceProvider
- Dongle
- ExpandoModel
- MigrationServiceProvider
- Model
- ModelBehavior
- ModelException
- MorphPivot
- NestedTreeScope
- Pivot
- QueryBuilder
- Replicator
- SortableScope
- TreeCollection
- Updater
-
-
Element
-
Filter
-
Form
-
Lists
-
Navigation
- ElementBase
- ElementHolder
-
-
Events
-
Exception
-
Extension
-
Filesystem
-
Flash
-
Foundation
-
Bootstrap
-
Console
-
Exception
-
Http
-
Middleware
- Kernel
-
-
Providers
- Application
-
-
Halcyon
-
Concerns
-
Datasource
-
Exception
-
Processors
-
Traits
- README
- Builder
- Collection
- HalcyonServiceProvider
- Model
-
-
Html
-
Mail
-
Network
-
Parse
-
Resize
-
Router
-
Scaffold
-
Support
-
Debug
-
Facades
-
Traits
- README
- Arr
- ClassLoader
- Collection
- Facade
- ModuleServiceProvider
- SafeCollection
- ServiceProvider
- Singleton
- Str
-
-
Translation
-
Validation
-
- Documentation
- API
- Library
- Database
- Relations
- AttachMany
October\Rain\Database\Relations\AttachMany
Extends
- Illuminate\Database\Eloquent\Relations\MorphMany
- Illuminate\Database\Eloquent\Relations\MorphOneOrMany
- Illuminate\Database\Eloquent\Relations\HasOneOrMany
- Illuminate\Database\Eloquent\Relations\Relation
Implements
- Illuminate\Contracts\Database\Eloquent\Builder
- Illuminate\Contracts\Database\Query\Builder
Public Properties
There are no public properties in the class.
Show inherited public properties
Inherited Public Properties
- $morphMap - An array to map class names to their morph names in the database. (defined in Illuminate\Database\Eloquent\Relations\Relation)
Protected Properties
protected string $relationName
relationName is the "name" of the relationship
protected bool $public
public is a default value for file public or protected state
Show inherited protected properties
Inherited Protected Properties
- $morphType - The foreign key type for the relationship. (defined in Illuminate\Database\Eloquent\Relations\MorphOneOrMany)
- $morphClass - The class name of the parent model. (defined in Illuminate\Database\Eloquent\Relations\MorphOneOrMany)
- $foreignKey - The foreign key of the parent model. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrMany)
- $localKey - The local key of the parent model. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrMany)
- $query - The Eloquent query builder instance. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- $parent - The parent model instance. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- $related - The related model instance. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- $constraints - Indicates if the relation is adding constraints. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- $requireMorphMap - Prevents morph relationships without a morph map. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- $selfJoinCount - The count of self joins. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- $macros - The registered string macros. (defined in Illuminate\Database\Eloquent\Relations\Relation)
Public Methods
public __construct()
public __construct( $query, $parent, $type, $id, $isPublic, $localKey, $relationName = null ): void
__construct a new has many relationship instance.
public add()
public add($model, $sessionKey = null): void
add a model to this relationship type
public addCommonEagerConstraints()
public addCommonEagerConstraints(array $models): void
addCommonEagerConstraints adds constraints without the field constraint, used to eager load multiple relations of a common type.
See Also
public addConstraints()
public addConstraints(): void
addConstraints sets the field (relation name) constraint on the query
public addDefinedConstraints()
public addDefinedConstraints(): void
addDefinedConstraints to the relation query
public addDefinedConstraintsToQuery()
public addDefinedConstraintsToQuery($query, $args = null): void
public addDefinedConstraintsToRelation()
public addDefinedConstraintsToRelation($relation, $args = null): void
public addEagerConstraints()
public addEagerConstraints(array $models): void
addEagerConstraints sets the field constraint for an eager load of the relation
public addMany()
public addMany(array $models, $sessionKey = null): void
addMany attaches an array of models to the parent instance with deferred binding support
public create()
public create($attributes = [], $sessionKey = null): void
create a new instance of this related model
public createFromFile()
public createFromFile($filePath, $attributes = [], $sessionKey = null): void
public getForeignKey()
public getForeignKey(): void
public getOtherKey()
public getOtherKey(): void
public getRelationExistenceQuery()
public getRelationExistenceQuery( Illuminate\Database\Eloquent\Builder $query, Illuminate\Database\Eloquent\Builder $parentQuery, array|mixed $columns = [ 0 => '*'] ): Illuminate\Database\Eloquent\Builder
getRelationExistenceQuery adds the constraints for a relationship count query
public getRelationExistenceQueryForSelfRelation()
public getRelationExistenceQueryForSelfRelation( Illuminate\Database\Eloquent\Builder $query, Illuminate\Database\Eloquent\Builder $parentQuery, array|mixed $columns = [ 0 => '*'] ): Illuminate\Database\Eloquent\Builder
getRelationExistenceQueryForSelfRelation adds the constraints for a relationship query on the same table
public getSimpleValue()
public getSimpleValue(): array|null
getSimpleValue helper for getting this relationship simple value, generally useful with form values.
public isPublic()
public isPublic(): void
isPublic determines if the file should be flagged "public" or not
public makeValidationFile()
public makeValidationFile($value): void
public remove()
public remove($model, $sessionKey = null): void
remove a model from this relationship type
public save()
public save($model, $sessionKey = null): void
save the supplied related model
public setSimpleValue()
public setSimpleValue(mixed $value): void
setSimpleValue helper for setting this relationship using various expected values. For example, $model->relation = $value;
public withDeferred()
public withDeferred( string|null $sessionKey = null ): Illuminate\Database\Query\Builder
withDeferred returns a new model query with deferred bindings added, this will reset any constraints that come before it
public withDeferredQuery()
public withDeferredQuery( Illuminate\Database\Query\Builder|null $newQuery = null, string|null $sessionKey = null ): Illuminate\Database\Query\Builder
withDeferredQuery returns the supplied model query, or current model query, with deferred bindings added, this will preserve any constraints that came before it
Inherited Public Methods
- __call() - Handle dynamic method calls to the relationship. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- __callStatic() - Dynamically handle calls to the class. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- __clone() - Force a clone of the underlying query builder when cloning. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- createMany() - Create a Collection of new instances of the related model. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrMany)
- createManyQuietly() - Create a Collection of new instances of the related model without raising any events to the parent model. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrMany)
- createQuietly() - Create a new instance of the related model without raising any events to the parent model. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrMany)
- createdAt() - Get the name of the "created at" column. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- enforceMorphMap() - Define the morph map for polymorphic relations and require all morphed models to be explicitly mapped. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- findOrNew() - Find a model by its primary key or return a new instance of the related model. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrMany)
- firstOrCreate() - Get the first related record matching the attributes or create it. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrMany)
- firstOrNew() - Get the first related model record matching the attributes or instantiate it. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrMany)
- flushMacros() - Flush the existing macros. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- forceCreate() - Create a new instance of the related model. Allow mass-assignment. (defined in Illuminate\Database\Eloquent\Relations\MorphMany)
- get() - Execute the query as a "select" statement. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- getBaseQuery() - Get the base query builder driving the Eloquent builder. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- getEager() - Get the relationship for eager loading. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- getExistenceCompareKey() - Get the key for comparing against the parent key in "has" query. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrMany)
- getForeignKeyName() - Get the plain foreign key. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrMany)
- getLocalKeyName() - Get the local key for the relationship. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrMany)
- getMorphClass() - Get the class name of the parent model. (defined in Illuminate\Database\Eloquent\Relations\MorphOneOrMany)
- getMorphType() - Get the plain morph type name without the table. (defined in Illuminate\Database\Eloquent\Relations\MorphOneOrMany)
- getMorphedModel() - Get the model associated with a custom polymorphic type. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- getParent() - Get the parent model of the relation. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- getParentKey() - Get the key value of the parent's local key. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrMany)
- getQualifiedForeignKeyName() - Get the foreign key for the relationship. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrMany)
- getQualifiedMorphType() - Get the foreign key "type" name. (defined in Illuminate\Database\Eloquent\Relations\MorphOneOrMany)
- getQualifiedParentKeyName() - Get the fully qualified parent key name. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrMany)
- getQuery() - Get the underlying query for the relation. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- getRelated() - Get the related model of the relation. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- getRelationCountHash() - Get a relationship join table hash. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- getRelationExistenceCountQuery() - Add the constraints for a relationship count query. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- getResults() - Get the results of the relationship. (defined in Illuminate\Database\Eloquent\Relations\MorphMany)
- hasMacro() - Checks if macro is registered. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- initRelation() - Initialize the relation on a set of models. (defined in Illuminate\Database\Eloquent\Relations\MorphMany)
- macro() - Register a custom macro. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- macroCall() - Dynamically handle calls to the class. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- make() - Create and return an un-saved instance of the related model. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrMany)
- makeMany() - Create and return an un-saved instance of the related models. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrMany)
- match() - Match the eagerly loaded results to their parents. (defined in Illuminate\Database\Eloquent\Relations\MorphMany)
- matchMany() - Match the eagerly loaded results to their many parents. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrMany)
- matchOne() - Match the eagerly loaded results to their single parents. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrMany)
- mixin() - Mix another object into the class. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- morphMap() - Set or get the morph map for polymorphic relations. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- noConstraints() - Run a callback with constraints disabled on the relation. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- rawUpdate() - Run a raw update against the base query. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- relatedUpdatedAt() - Get the name of the related model's "updated at" column. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- requireMorphMap() - Prevent polymorphic relationships from being used without model mappings. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- requiresMorphMap() - Determine if polymorphic relationships require explicit model mapping. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- saveMany() - Attach a collection of models to the parent instance. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrMany)
- saveManyQuietly() - Attach a collection of models to the parent instance without raising any events to the parent model. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrMany)
- saveQuietly() - Attach a model instance without raising any events to the parent model. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrMany)
- sole() - Execute the query and get the first result if it's the sole matching record. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- toBase() - Get a base query builder instance. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- touch() - Touch all of the related models for the relationship. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- updateOrCreate() - Create or update a related record matching the attributes, and fill it with values. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrMany)
- updatedAt() - Get the name of the "updated at" column. (defined in Illuminate\Database\Eloquent\Relations\Relation)
Protected Methods
protected ensureAttachOneIsSingular()
protected ensureAttachOneIsSingular($sessionKey = null): void
ensureAttachOneIsSingular ensures AttachOne only has one attachment, by deleting siblings for singular relations.
protected getWithDeferredQualifiedKeyName()
protected getWithDeferredQualifiedKeyName( ): Illuminate\Database\Query\Expression
getWithDeferredQualifiedKeyName returns the related "slave id" key in a database friendly format.
protected isModelRemovable()
protected isModelRemovable($model): bool
isModelRemovable returns true if an existing model is already associated
Show inherited protected methods
Inherited Protected Methods
- buildDictionary() - Build model dictionary keyed by the relation's foreign key. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrMany)
- buildMorphMapFromModels() - Builds a table-keyed array from model class names. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- forwardCallTo() - Forward a method call to the given object. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- forwardDecoratedCallTo() - Forward a method call to the given object, returning $this if the forwarded call returned itself. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- getDictionaryKey() - Get a dictionary key attribute - casting it to a string if necessary. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrMany)
- getKeys() - Get all of the primary keys for an array of models. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- getRelationQuery() - Get the query builder that will contain the relationship constraints. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- getRelationValue() - Get the value of a relationship by one or many type. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrMany)
- matchOneOrMany() - Match the eagerly loaded results to their many parents. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrMany)
- setForeignAttributesForCreate() - Set the foreign ID and type for creating a related model. (defined in Illuminate\Database\Eloquent\Relations\MorphOneOrMany)
- throwBadMethodCallException() - Throw a bad method call exception for the given method. (defined in Illuminate\Database\Eloquent\Relations\Relation)
- whereInMethod() - Get the name of the "where in" method for eager loading. (defined in Illuminate\Database\Eloquent\Relations\Relation)