Skip to content

Commit

Permalink
API Use new names for renamed classes (#606)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli authored Sep 23, 2024
1 parent 7982c2a commit 6500858
Show file tree
Hide file tree
Showing 50 changed files with 72 additions and 72 deletions.
6 changes: 3 additions & 3 deletions docs/en/05_plugins/03_writing_a_complex_plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class GeocodableModelPlugin implements ModelTypePlugin
);

// only apply the plugin to geocodable DataObjects
if (!ViewableData::has_extension($class, GeocodableExtension::class)) {
if (!ModelData::has_extension($class, GeocodableExtension::class)) {
return;
}

Expand Down Expand Up @@ -100,7 +100,7 @@ class GeocodableQueryPlugin implements ModelQueryPlugin
{
$class = $query->getModel()->getSourceClass();
// Only apply to geocodable objects
if (!ViewableData::has_extension($class, GeocodableExtension::class)) {
if (!ModelData::has_extension($class, GeocodableExtension::class)) {
return;
}
Expand Down Expand Up @@ -216,7 +216,7 @@ class GeocodableQueryPlugin implements ModelQueryPlugin, SchemaUpdater
{
$class = $query->getModel()->getSourceClass();
// Only apply to geocodable objects
if (!ViewableData::has_extension($class, GeocodableExtension::class)) {
if (!ModelData::has_extension($class, GeocodableExtension::class)) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Auth/AuthenticatorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace SilverStripe\GraphQL\Auth;

use SilverStripe\Control\HTTPRequest;
use SilverStripe\ORM\ValidationException;
use SilverStripe\Core\Validation\ValidationException;
use SilverStripe\Security\Member;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Auth/BasicAuthAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use SilverStripe\Control\HTTPRequest;
use SilverStripe\Control\HTTPResponse_Exception;
use SilverStripe\ORM\ValidationException;
use SilverStripe\Core\Validation\ValidationException;
use SilverStripe\Security\BasicAuth;
use SilverStripe\Security\Member;

Expand Down
2 changes: 1 addition & 1 deletion src/Auth/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use SilverStripe\Core\ClassInfo;
use SilverStripe\Core\Config\Configurable;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\ORM\ValidationException;
use SilverStripe\Core\Validation\ValidationException;
use SilverStripe\Security\Member;

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Modules/AssetAdmin/FileFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
use SilverStripe\Assets\Folder;
use SilverStripe\Control\HTTPResponse_Exception;
use SilverStripe\Forms\DateField;
use SilverStripe\ORM\ArrayList;
use SilverStripe\ORM\Filterable;
use SilverStripe\Model\List\ArrayList;
use SilverStripe\Model\List\Filterable;

class FileFilter
{
Expand Down
2 changes: 1 addition & 1 deletion src/Modules/AssetAdmin/Resolvers/AssetAdminResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use SilverStripe\GraphQL\QueryHandler\UserContextProvider;
use SilverStripe\GraphQL\Schema\DataObject\FieldAccessor;
use SilverStripe\ORM\DataList;
use SilverStripe\ORM\Filterable;
use SilverStripe\Model\List\Filterable;
use SilverStripe\Versioned\Versioned;
use InvalidArgumentException;

Expand Down
2 changes: 1 addition & 1 deletion src/Modules/AssetAdmin/Resolvers/FolderTypeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use SilverStripe\GraphQL\Schema\Schema;
use SilverStripe\ORM\DataList;
use SilverStripe\ORM\DB;
use SilverStripe\ORM\Sortable;
use SilverStripe\Model\List\Sortable;
use SilverStripe\Versioned\Versioned;
use InvalidArgumentException;
use Exception;
Expand Down
2 changes: 1 addition & 1 deletion src/Modules/AssetAdmin/Schema/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use SilverStripe\GraphQL\Schema\Interfaces\SchemaUpdater;
use SilverStripe\GraphQL\Schema\Schema;
use SilverStripe\GraphQL\Schema\Type\Enum;
use SilverStripe\ORM\ArrayLib;
use SilverStripe\Core\ArrayLib;

if (!interface_exists(SchemaUpdater::class)) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/Modules/CMS/LinkablePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use SilverStripe\GraphQL\Schema\Field\ModelQuery;
use SilverStripe\GraphQL\Schema\Interfaces\ModelQueryPlugin;
use SilverStripe\GraphQL\Schema\Schema;
use SilverStripe\ORM\ArrayList;
use SilverStripe\Model\List\ArrayList;
use SilverStripe\ORM\DataList;

if (!interface_exists(ModelQueryPlugin::class)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\DataObjectInterface;
use SilverStripe\ORM\DB;
use SilverStripe\ORM\ValidationException;
use SilverStripe\Core\Validation\ValidationException;
use SilverStripe\Security\Member;
use SilverStripe\GraphQL\Modules\Versioned\Resolvers\VersionedResolver;
use SilverStripe\Versioned\Versioned;
use SilverStripe\View\ViewableData;
use SilverStripe\Model\ModelData;

// GraphQL dependency is optional in versioned,
// and the following implementation relies on existence of this class (in GraphQL v4)
Expand Down Expand Up @@ -53,7 +53,7 @@ public function createOperation(
string $typeName,
array $config = []
): ?ModelOperation {
if (!ViewableData::has_extension($model->getSourceClass(), Versioned::class)) {
if (!ModelData::has_extension($model->getSourceClass(), Versioned::class)) {
return null;
}

Expand Down
4 changes: 2 additions & 2 deletions src/Modules/Versioned/Operations/CopyToStageCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use SilverStripe\GraphQL\Schema\Interfaces\SchemaModelInterface;
use SilverStripe\GraphQL\Modules\Versioned\Resolvers\VersionedResolver;
use SilverStripe\Versioned\Versioned;
use SilverStripe\View\ViewableData;
use SilverStripe\Model\ModelData;

// GraphQL dependency is optional in versioned,
// and the following implementation relies on existence of this class (in GraphQL v4)
Expand Down Expand Up @@ -49,7 +49,7 @@ public function createOperation(
string $typeName,
array $config = []
): ?ModelOperation {
if (!ViewableData::has_extension($model->getSourceClass(), Versioned::class)) {
if (!ModelData::has_extension($model->getSourceClass(), Versioned::class)) {
return null;
}

Expand Down
4 changes: 2 additions & 2 deletions src/Modules/Versioned/Operations/RollbackCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use SilverStripe\GraphQL\Schema\Interfaces\SchemaModelInterface;
use SilverStripe\GraphQL\Modules\Versioned\Resolvers\VersionedResolver;
use SilverStripe\Versioned\Versioned;
use SilverStripe\View\ViewableData;
use SilverStripe\Model\ModelData;

// GraphQL dependency is optional in versioned,
// and the following implementation relies on existence of this class (in GraphQL v4)
Expand Down Expand Up @@ -47,7 +47,7 @@ public function createOperation(
string $typeName,
array $config = []
): ?ModelOperation {
if (!ViewableData::has_extension($model->getSourceClass(), Versioned::class)) {
if (!ModelData::has_extension($model->getSourceClass(), Versioned::class)) {
return null;
}

Expand Down
4 changes: 2 additions & 2 deletions src/Modules/Versioned/Plugins/UnpublishOnDelete.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use SilverStripe\Versioned\Versioned;
use Exception;
use Closure;
use SilverStripe\View\ViewableData;
use SilverStripe\Model\ModelData;

// GraphQL dependency is optional in versioned,
// and the following implementation relies on existence of this class (in GraphQL v4)
Expand Down Expand Up @@ -53,7 +53,7 @@ public static function unpublishOnDelete(array $context)
if (!$dataClass) {
return;
}
if (!ViewableData::has_extension($dataClass, Versioned::class)) {
if (!ModelData::has_extension($dataClass, Versioned::class)) {
return;
}
DB::get_conn()->withTransaction(function () use ($args, $context, $dataClass) {
Expand Down
6 changes: 3 additions & 3 deletions src/Modules/Versioned/Plugins/VersionedDataObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
use SilverStripe\GraphQL\Schema\Type\ModelType;
use SilverStripe\GraphQL\Schema\Type\Type;
use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\Sortable;
use SilverStripe\Model\List\Sortable;
use SilverStripe\Security\Member;
use SilverStripe\GraphQL\Modules\Versioned\Resolvers\VersionedResolver;
use SilverStripe\Versioned\Versioned;
use Closure;
use SilverStripe\View\ViewableData;
use SilverStripe\Model\ModelData;

// GraphQL dependency is optional in versioned,
// and the following implementation relies on existence of this class (in GraphQL v4)
Expand Down Expand Up @@ -75,7 +75,7 @@ public function apply(ModelType $type, Schema $schema, array $config = []): void
__CLASS__,
DataObject::class
);
if (!ViewableData::has_extension($class, Versioned::class)) {
if (!ModelData::has_extension($class, Versioned::class)) {
return;
}

Expand Down
4 changes: 2 additions & 2 deletions src/Modules/Versioned/Plugins/VersionedRead.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use SilverStripe\GraphQL\Schema\Schema;
use SilverStripe\GraphQL\Modules\Versioned\Resolvers\VersionedResolver;
use SilverStripe\Versioned\Versioned;
use SilverStripe\View\ViewableData;
use SilverStripe\Model\ModelData;

// GraphQL dependency is optional in versioned,
// and the following implementation relies on existence of this class (in GraphQL v4)
Expand Down Expand Up @@ -36,7 +36,7 @@ public function getIdentifier(): string
public function apply(ModelQuery $query, Schema $schema, array $config = []): void
{
$class = $query->getModel()->getSourceClass();
if (!ViewableData::has_extension($class, Versioned::class)) {
if (!ModelData::has_extension($class, Versioned::class)) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Modules/Versioned/Resolvers/VersionedResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use SilverStripe\ORM\DataList;
use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\DB;
use SilverStripe\ORM\ValidationException;
use SilverStripe\Core\Validation\ValidationException;
use SilverStripe\GraphQL\Modules\Versioned\Operations\AbstractPublishOperationCreator;
use SilverStripe\GraphQL\Modules\Versioned\Operations\CopyToStageCreator;
use SilverStripe\GraphQL\Modules\Versioned\Operations\RollbackCreator;
Expand Down
2 changes: 1 addition & 1 deletion src/QueryHandler/QueryHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
use SilverStripe\GraphQL\Schema\Interfaces\ContextProvider;
use SilverStripe\GraphQL\Schema\Schema;
use SilverStripe\GraphQL\Schema\SchemaConfig;
use SilverStripe\ORM\ValidationException;
use SilverStripe\Core\Validation\ValidationException;

/**
* This class is responsible for taking query information from a controller,
Expand Down
6 changes: 3 additions & 3 deletions src/Schema/BulkLoader/ExtensionLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use InvalidArgumentException;
use SilverStripe\Core\Extension;
use SilverStripe\View\ViewableData;
use SilverStripe\Model\ModelData;

/**
* Loads classes that have a given extension assigned to them.
Expand All @@ -25,13 +25,13 @@ public function collect(Collection $collection): Collection
foreach ($collection->getClasses() as $class) {
$isIncluded = false;
foreach ($this->includeList as $pattern) {
if (ViewableData::has_extension($class, $pattern)) {
if (ModelData::has_extension($class, $pattern)) {
$isIncluded = true;
break;
}
}
foreach ($this->excludeList as $pattern) {
if (ViewableData::has_extension($class, $pattern)) {
if (ModelData::has_extension($class, $pattern)) {
$isIncluded = false;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Schema/DataObject/DataObjectModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
use SilverStripe\GraphQL\Schema\Interfaces\SchemaModelInterface;
use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\FieldType\DBField;
use SilverStripe\ORM\SS_List;
use SilverStripe\Model\List\SS_List;
use SilverStripe\ORM\UnsavedRelationList;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Schema/DataObject/FieldAccessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use SilverStripe\ORM\DataObjectSchema;
use SilverStripe\ORM\FieldType\DBField;
use SilverStripe\ORM\RelationList;
use SilverStripe\ORM\SS_List;
use SilverStripe\Model\List\SS_List;
use LogicException;
use SilverStripe\ORM\UnsavedRelationList;

Expand Down
10 changes: 5 additions & 5 deletions src/Schema/DataObject/Plugin/CanViewPermission.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
use SilverStripe\Core\ClassInfo;
use SilverStripe\GraphQL\QueryHandler\QueryHandler;
use SilverStripe\GraphQL\QueryHandler\UserContextProvider;
use SilverStripe\ORM\ArrayLib;
use SilverStripe\ORM\ArrayList;
use SilverStripe\ORM\Filterable;
use SilverStripe\Core\ArrayLib;
use SilverStripe\Model\List\ArrayList;
use SilverStripe\Model\List\Filterable;
use InvalidArgumentException;
use SilverStripe\ORM\SS_List;
use SilverStripe\View\ArrayData;
use SilverStripe\Model\List\SS_List;
use SilverStripe\Model\ArrayData;
use SilverStripe\ORM\DataList;

/**
Expand Down
6 changes: 3 additions & 3 deletions src/Schema/DataObject/Plugin/FirstResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
use SilverStripe\GraphQL\Schema\Schema;
use SilverStripe\ORM\DataList;
use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\SS_List;
use SilverStripe\View\ViewableData;
use SilverStripe\Model\List\SS_List;
use SilverStripe\Model\ModelData;

class FirstResult implements ModelQueryPlugin
{
Expand Down Expand Up @@ -38,7 +38,7 @@ public function apply(ModelQuery $query, Schema $schema, array $config = []): vo
$query->addResolverAfterware([static::class, 'firstResult']);
}

public static function firstResult(SS_List $obj): ?ViewableData
public static function firstResult(SS_List $obj): ?ModelData
{
return $obj->first();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Schema/DataObject/Plugin/Paginator.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use GraphQL\Type\Definition\ResolveInfo;
use SilverStripe\GraphQL\Schema\Schema;
use SilverStripe\ORM\Limitable;
use SilverStripe\Model\List\Limitable;
use SilverStripe\GraphQL\Schema\Plugin\PaginationPlugin;
use Closure;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter;

use SilverStripe\ORM\DataList;
use SilverStripe\ORM\Filterable;
use SilverStripe\Model\List\Filterable;

/**
* Defines the interface used by all read filters for operations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter\Filters;

use SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter\FieldFilterInterface;
use SilverStripe\ORM\Filterable;
use SilverStripe\Model\List\Filterable;

/**
* A filter that selects records that partially match a keyword
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter\Filters;

use SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter\FieldFilterInterface;
use SilverStripe\ORM\Filterable;
use SilverStripe\Model\List\Filterable;

/**
* A query filter that filters records by the end of a field's contents
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter\Filters;

use SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter\FieldFilterInterface;
use SilverStripe\ORM\Filterable;
use SilverStripe\Model\List\Filterable;

/**
* A query filter that filters records by exact match of a keyword
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter\Filters;

use SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter\FieldFilterInterface;
use SilverStripe\ORM\Filterable;
use SilverStripe\Model\List\Filterable;

/**
* A query filter that filters records by greater than comparison
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter\Filters;

use SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter\FieldFilterInterface;
use SilverStripe\ORM\Filterable;
use SilverStripe\Model\List\Filterable;

/**
* A query filter that filters records by greater than or equal comparison
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter\Filters;

use SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter\ListFieldFilterInterface;
use SilverStripe\ORM\Filterable;
use SilverStripe\Model\List\Filterable;

/**
* A query filter that filters records by the presence of a value in an array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter\Filters;

use SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter\FieldFilterInterface;
use SilverStripe\ORM\Filterable;
use SilverStripe\Model\List\Filterable;

/**
* A query filter that filters records by a less than comparison
Expand Down
Loading

0 comments on commit 6500858

Please sign in to comment.