Skip to content

Commit

Permalink
Adds setExpandoAttributes
Browse files Browse the repository at this point in the history
  • Loading branch information
daftspunk committed Apr 5, 2024
1 parent 6f574f9 commit 0142280
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Database/ExpandoModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ public function __construct(array $attributes = [])
$this->addJsonable($this->expandoColumn);
}

/**
* setExpandoAttributes on the model and protects the passthru values
*/
public function setExpandoAttributes(array $attributes = [])
{
$this->attributes = array_merge(
$this->attributes,
array_diff_key($attributes, array_flip($this->getExpandoPassthru()))
);
}

/**
* expandoAfterFetch constructor event
*/
Expand Down

0 comments on commit 0142280

Please sign in to comment.