Skip to content

Commit

Permalink
API Use updated Versioned and Staged classes
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Oct 29, 2024
1 parent a17c038 commit 807f3b6
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions docs/en/01_basic_usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,13 @@ class MyModel extends DataObject
## Unversioned links

The `Link` model has the [`Versioned`](api:SilverStripe\Versioned\Versioned) extension applied to it by default. If you wish for links to not be versioned, then remove the extension from the `Link` model in the project's `app/_config.php` file.
The `Link` model has the [`Versioned`](api:SilverStripe\Versioned\Mode\Versioned) extension applied to it by default. If you wish for links to not be versioned, then remove the extension from the `Link` model in the project's `app/_config.php` file.

```php
// app/_config.php

use SilverStripe\LinkField\Models\Link;
use SilverStripe\Versioned\Versioned;
use SilverStripe\Versioned\Mode\Versioned;

Link::remove_extension(Versioned::class);
```
Expand Down
2 changes: 1 addition & 1 deletion docs/en/09_migrating/02_gorriecoe-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ There are many extension hooks in the [`GorriecoeMigrationTask`](api:SilverStrip

Some scenarios where you may need customisations include:

- You had applied the [`Versioned`](api:SilverStripe\Versioned\Versioned) extension to `Link` and want to retain that versioning history
- You had applied the [`Versioned`](api:SilverStripe\Versioned\Mode\Versioned) extension to `Link` and want to retain that versioning history
- You subclassed the base `Link` model and need to migrate data from your custom subclass
- You were relying on features of `gorriecoe/silverstripe-link` or `gorriecoe/silverstripe-linkfield` which don't have a 1-to-1 equivalent in `silverstripe/linkfield`

Expand Down
2 changes: 1 addition & 1 deletion src/Controllers/LinkFieldController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
use SilverStripe\LinkField\Form\LinkField;
use SilverStripe\LinkField\Form\MultiLinkField;
use SilverStripe\ORM\Queries\SQLUpdate;
use SilverStripe\Versioned\Versioned;
use SilverStripe\Versioned\Mode\Versioned;

class LinkFieldController extends LeftAndMain
{
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Link.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\DataObjectSchema;
use SilverStripe\ORM\FieldType\DBHTMLText;
use SilverStripe\Versioned\Versioned;
use SilverStripe\Versioned\Mode\Versioned;
use SilverStripe\Forms\Tip;
use SilverStripe\LinkField\Form\LinkField;
use SilverStripe\LinkField\Form\MultiLinkField;
Expand Down
6 changes: 3 additions & 3 deletions src/Tasks/MigrationTaskTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
use SilverStripe\ORM\DataObjectSchema;
use SilverStripe\ORM\DB;
use SilverStripe\ORM\Queries\SQLUpdate;
use SilverStripe\Versioned\ChangeSet;
use SilverStripe\Versioned\ChangeSetItem;
use SilverStripe\Versioned\Versioned;
use SilverStripe\Versioned\Staged\ChangeSet;
use SilverStripe\Versioned\Staged\ChangeSetItem;
use SilverStripe\Versioned\Mode\Versioned;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
Expand Down
2 changes: 1 addition & 1 deletion src/Tasks/ModuleMigrationTaskTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use SilverStripe\ORM\Queries\SQLDelete;
use SilverStripe\ORM\Queries\SQLSelect;
use SilverStripe\ORM\Queries\SQLUpdate;
use SilverStripe\Versioned\Versioned;
use SilverStripe\Versioned\Mode\Versioned;

/**
* @deprecated 5.0.0 Will be removed without equivalent functionality.
Expand Down
2 changes: 1 addition & 1 deletion tests/php/Controllers/LinkFieldControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use SilverStripe\Control\Session;
use SilverStripe\LinkField\Controllers\LinkFieldController;
use SilverStripe\LinkField\Tests\Models\LinkTest\LinkOwner;
use SilverStripe\Versioned\Versioned;
use SilverStripe\Versioned\Mode\Versioned;
use SilverStripe\LinkField\Models\Link;
use PHPUnit\Framework\Attributes\DataProvider;

Expand Down
2 changes: 1 addition & 1 deletion tests/php/Models/LinkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use SilverStripe\LinkField\Models\SiteTreeLink;
use SilverStripe\ORM\DataObject;
use SilverStripe\Core\Validation\ValidationException;
use SilverStripe\Versioned\Versioned;
use SilverStripe\Versioned\Mode\Versioned;
use SilverStripe\LinkField\Tests\Extensions\ExternalLinkExtension;
use SilverStripe\LinkField\Tests\Models\LinkTest\LinkOwner;
use SilverStripe\LinkField\Services\LinkTypeService;
Expand Down
2 changes: 1 addition & 1 deletion tests/php/Models/LinkTest/LinkOwner.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use SilverStripe\Dev\TestOnly;
use SilverStripe\LinkField\Models\Link;
use SilverStripe\ORM\DataObject;
use SilverStripe\Versioned\Versioned;
use SilverStripe\Versioned\Mode\Versioned;

class LinkOwner extends DataObject implements TestOnly
{
Expand Down

0 comments on commit 807f3b6

Please sign in to comment.