Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes 9: Remove content storage class #6456

Merged
merged 4 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Cms/Language.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public static function create(array $props): static

if ($languages->count() === 0) {
foreach ($kirby->models() as $model) {
$model->storage()->convertLanguage(
$model->storage()->moveLanguage(
Language::single(),
$language
);
Expand Down Expand Up @@ -227,9 +227,9 @@ public function delete(): bool

foreach ($kirby->models() as $model) {
if ($this->isLast() === true) {
$model->storage()->convertLanguage($this, Language::single());
$model->storage()->moveLanguage($this, Language::single());
} else {
$model->storage()->deleteLanguage($code);
$model->storage()->deleteLanguage($this);
}
}

Expand Down
11 changes: 5 additions & 6 deletions src/Cms/ModelWithContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Closure;
use Kirby\Content\Content;
use Kirby\Content\ContentStorage;
use Kirby\Content\ContentStorageHandler;
use Kirby\Content\ContentTranslation;
use Kirby\Content\PlainTextContentStorageHandler;
use Kirby\Content\Version;
Expand Down Expand Up @@ -48,7 +48,7 @@ abstract class ModelWithContent implements Identifiable, Stringable
public Content|null $content;
public static App $kirby;
protected Site|null $site;
protected ContentStorage $storage;
protected ContentStorageHandler $storage;
public Collection|null $translations = null;

/**
Expand Down Expand Up @@ -566,11 +566,10 @@ public function site(): Site
* Returns the content storage handler
* @internal
*/
public function storage(): ContentStorage
public function storage(): ContentStorageHandler
{
return $this->storage ??= new ContentStorage(
model: $this,
handler: PlainTextContentStorageHandler::class
return $this->storage ??= new PlainTextContentStorageHandler(
model: $this,
);
}

Expand Down
282 changes: 0 additions & 282 deletions src/Content/ContentStorage.php

This file was deleted.

Loading
Loading