AttachOne
class Winter\Storm\Database\Relations\AttachOne
extends Illuminate\Database\Eloquent\Relations\MorphOne
Extends
Class | Description |
---|---|
Illuminate\Database\Eloquent\Relations\MorphOne
|
Traits
Trait | Description |
---|---|
AttachOneOrMany
|
|
DefinedConstraints
|
Properties
inherited protected $public : ?bool
Default value for file public or protected state.
inherited protected $relationName : string
The "name" of the relationship.
Methods
public
__construct (Illuminate\Database\Eloquent\Builder $query, Illuminate\Database\Eloquent\Model $parent, string $type, string $id, bool $isPublic, string $localKey, null | string $relationName = null
)
Create a new has many relationship instance.
Property | Type | Description |
---|---|---|
$query | Illuminate\Database\Eloquent\Builder |
Illuminate\Database\Eloquent\Builder
|
$parent | Illuminate\Database\Eloquent\Model |
Illuminate\Database\Eloquent\Model
|
$type | string |
string
|
$id | string |
string
|
$isPublic | bool |
bool
|
$localKey | string |
string
|
$relationName | null | string |
null | string
|
public getSimpleValue ()
Helper for getting this relationship simple value, generally useful with form values.
public getValidationValue ()
Helper for getting this relationship validation value.
public setSimpleValue ($value)
Helper for setting this relationship using various expected values. For example, $model->relation = $value;
Property | Type | Description |
---|---|---|
$value | mixed |
mixed
|
protected getSimpleValueInternal ()
Internal method used by getSimpleValue
and getValidationValue
inherited
public
add (Illuminate\Database\Eloquent\Model $model, $sessionKey = null
)
Adds a model to this relationship type.
Property | Type | Description |
---|---|---|
$model | Illuminate\Database\Eloquent\Model |
Illuminate\Database\Eloquent\Model
|
$sessionKey | mixed |
mixed
|
inherited public addConstraints () : void
Set the field (relation name) constraint on the query.
inherited public addDefinedConstraints () : void
Set the defined constraints on the relation query.
inherited
public
addDefinedConstraintsToQuery (Illuminate\Database\Eloquent\Relations\Relation | Winter\Storm\Database\QueryBuilder $query, array | null $args = null
)
Add query based constraints.
Property | Type | Description |
---|---|---|
$query | Illuminate\Database\Eloquent\Relations\Relation | Winter\Storm\Database\QueryBuilder |
Illuminate\Database\Eloquent\Relations\Relation | Winter\Storm\Database\QueryBuilder
|
$args | array | null |
array | null
|
inherited
public
addDefinedConstraintsToRelation (Illuminate\Database\Eloquent\Relations\Relation $relation, array | null $args = null
)
Add relation based constraints.
Property | Type | Description |
---|---|---|
$relation | Illuminate\Database\Eloquent\Relations\Relation |
Illuminate\Database\Eloquent\Relations\Relation
|
$args | array | null |
array | null
|
inherited public addEagerConstraints (array $models) : void
Set the field constraint for an eager load of the relation.
Property | Type | Description |
---|---|---|
$models | array |
array
|
inherited
public
addMany (array $models, $sessionKey = null
)
: void
Attach an array of models to the parent instance with deferred binding support.
Property | Type | Description |
---|---|---|
$models | array |
array
|
$sessionKey | mixed |
mixed
|
inherited
public
create (array $attributes = []
, $sessionKey = null
)
Create a new instance of this related model.
Property | Type | Description |
---|---|---|
$attributes | array |
array
|
$sessionKey | mixed |
mixed
|
inherited public getForeignKey () : string
Get the foreign key for the relationship.
inherited public getOtherKey () : string
Get the associated "other" key of the relationship.
inherited
public
getRelationExistenceQuery (Illuminate\Database\Eloquent\Builder $query, Illuminate\Database\Eloquent\Builder $parentQuery, array $columns = ["*"]
)
: Illuminate\Database\Eloquent\Builder
Add the constraints for a relationship count query.
Property | Type | Description |
---|---|---|
$query | Illuminate\Database\Eloquent\Builder |
Illuminate\Database\Eloquent\Builder
|
$parentQuery | Illuminate\Database\Eloquent\Builder |
Illuminate\Database\Eloquent\Builder
|
$columns | array |
array
|
inherited
public
getRelationExistenceQueryForSelfRelation (Illuminate\Database\Eloquent\Builder $query, Illuminate\Database\Eloquent\Builder $parentQuery, array $columns = ["*"]
)
: Illuminate\Database\Eloquent\Builder
Add the constraints for a relationship query on the same table.
Property | Type | Description |
---|---|---|
$query | Illuminate\Database\Eloquent\Builder |
Illuminate\Database\Eloquent\Builder
|
$parentQuery | Illuminate\Database\Eloquent\Builder |
Illuminate\Database\Eloquent\Builder
|
$columns | array |
array
|
inherited public isPublic ()
Determines if the file should be flagged "public" or not.
inherited public makeValidationFile (mixed $value) : UploadedFile
Creates a file object suitable for validation, called from
the getValidationValue
method. Value can be a file model,
UploadedFile object (expected) or potentially a string.
Property | Type | Description |
---|---|---|
$value | mixed |
mixed
|
inherited
public
remove (Illuminate\Database\Eloquent\Model $model, $sessionKey = null
)
Removes a model from this relationship type.
Property | Type | Description |
---|---|---|
$model | Illuminate\Database\Eloquent\Model |
Illuminate\Database\Eloquent\Model
|
$sessionKey | mixed |
mixed
|
inherited
public
save (Illuminate\Database\Eloquent\Model $model, $sessionKey = null
)
Save the supplied related model.
Property | Type | Description |
---|---|---|
$model | Illuminate\Database\Eloquent\Model |
Illuminate\Database\Eloquent\Model
|
$sessionKey | mixed |
mixed
|
inherited protected isValidFileData ($value)
Returns true if the specified value can be used as the data attribute.
Property | Type | Description |
---|---|---|
$value | mixed |
mixed
|