Skip to content

Commit

Permalink
Use version method instead of direct storage access wherever possible
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianallgeier committed May 22, 2024
1 parent 650f3d3 commit 1568d28
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
5 changes: 2 additions & 3 deletions src/Cms/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -827,9 +827,8 @@ public function modified(
string|null $handler = null,
string|null $languageCode = null
): int|string|false|null {
$modified = $this->storage()->modified(
VersionId::default($this),
$languageCode
$modified = $this->version(VersionId::default($this))->modified(
$languageCode ?? 'current'
);

if ($modified === null) {
Expand Down
7 changes: 2 additions & 5 deletions src/Cms/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,7 @@ public function email(): string|null
*/
public function exists(): bool
{
return $this->storage()->exists(
VersionId::published(),
'default'
);
return $this->version(VersionId::published())->exists('default');
}

/**
Expand Down Expand Up @@ -469,7 +466,7 @@ public function modified(
string|null $handler = null,
string|null $languageCode = null
): int|string|false {
$modifiedContent = $this->storage()->modified(VersionId::published(), $languageCode);
$modifiedContent = $this->version(VersionId::published())->modified($languageCode ?? 'current');
$modifiedIndex = F::modified($this->root() . '/index.php');
$modifiedTotal = max([$modifiedContent, $modifiedIndex]);

Expand Down

0 comments on commit 1568d28

Please sign in to comment.