MetaFox

HasNestedAttributes

Trait HasNestedAttributes.

Tags
mixin

Model

mixin

HasRelationships

SuppressWarnings

(PHPMD.CyclomaticComplexity)

Table of Contents

Properties

$nestedAttributes  : array<string|int, string>
$nestedAttributesFor  : array<string|int, mixed>
Defined nested attributes.

Methods

fill()  : static
Fill the model with an array of attributes.
getNestedAttributesFor()  : array<string|int, mixed>
Get accept nested attributes.
save()  : bool
Save the model to the database.
syncHasManyRelationAttribute()  : bool
Save the hasMany nested relation attributes to the database.
syncHasOneRelationAttribute()  : bool
allowDestroyNestedAttributes()  : bool
Check can we delete nested data.

Properties

$nestedAttributesFor

Defined nested attributes.

protected array<string|int, mixed> $nestedAttributesFor = []

Methods

fill()

Fill the model with an array of attributes.

public fill(array<string|int, mixed> $attributes) : static
Parameters
$attributes : array<string|int, mixed>
Tags
throws
MassAssignmentException
Return values
static

getNestedAttributesFor()

Get accept nested attributes.

public getNestedAttributesFor() : array<string|int, mixed>
Return values
array<string|int, mixed>

save()

Save the model to the database.

public save([array<string|int, mixed> $options = [] ]) : bool
Parameters
$options : array<string|int, mixed> = []
Tags
throws
Exception
Return values
bool

syncHasManyRelationAttribute()

Save the hasMany nested relation attributes to the database.

public syncHasManyRelationAttribute(HasMany $relation, array<string|int, mixed> $params) : bool
Parameters
$relation : HasMany
$params : array<string|int, mixed>
Return values
bool

syncHasOneRelationAttribute()

public syncHasOneRelationAttribute(HasOne $relation, array<string|int, mixed> $params) : bool
Parameters
$relation : HasOne
$params : array<string|int, mixed>
Return values
bool

allowDestroyNestedAttributes()

Check can we delete nested data.

protected allowDestroyNestedAttributes(array<string|int, mixed> $params) : bool
Parameters
$params : array<string|int, mixed>
Return values
bool

        
On this page

Search results