Skip to content

Commit

Permalink
Adds sensible defaults to expando
Browse files Browse the repository at this point in the history
  • Loading branch information
daftspunk committed Apr 5, 2024
1 parent 6856412 commit 6f574f9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
12 changes: 11 additions & 1 deletion src/Database/ExpandoModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@ public function expandoAfterSave()
*/
protected function getExpandoPassthru()
{
return array_merge([$this->getKeyName(), $this->expandoColumn], $this->expandoPassthru);
$defaults = [
$this->expandoColumn,
$this->getKeyName(),
$this->getCreatedAtColumn(),
$this->getUpdatedAtColumn(),
'site_root_id',
'updated_user_id',
'created_user_id'
];

return array_merge($defaults, $this->expandoPassthru);
}
}
4 changes: 2 additions & 2 deletions src/Support/Facades/Site.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
* @method static bool hasAnyEditSite()
* @method static bool hasMultiEditSite()
* @method static iterable listEditEnabled()
* @method static iterable applyEditSite(mixed $site)
* @method static void applyEditSite(mixed $site)
* @method static mixed getActiveSite()
* @method static string getActiveSiteId()
* @method static void setActiveSiteId(string $siteId)
* @method static void setActiveSite(mixed $site)
* @method static iterable applyActiveSite(mixed $site)
* @method static void applyActiveSite(mixed $site)
* @method static array listSiteIdsInGroup($siteId)
* @method static array listSiteIdsInLocale($siteId)
* @method static int|null getSiteIdFromContext()
Expand Down

0 comments on commit 6f574f9

Please sign in to comment.