Source of file CopyToStageInputType.php
Size: 1,533 Bytes - Last Modified: 2021-12-23T10:35:47+00:00
/var/www/docs.ssmods.com/process/src/_legacy/GraphQL/Types/CopyToStageInputType.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 | <?php namespace SilverStripe\Versioned\GraphQL\Types; use GraphQL\Type\Definition\Type; use SilverStripe\GraphQL\Scaffolding\StaticSchema; use SilverStripe\GraphQL\TypeCreator; // GraphQL dependency is optional in versioned, // and legacy implementation relies on existence of this class (in GraphQL v3) if (!class_exists(TypeCreator::class)) { return; } /** * @deprecated 4.8..5.0 Use silverstripe/graphql:^4 functionality. */ class CopyToStageInputType extends TypeCreator { /** * @var bool */ protected $inputObject = true; /** * @return array */ public function attributes() { return [ 'name' => 'CopyToStageInputType' ]; } /** * @return array */ public function fields() { return StaticSchema::inst()->formatKeys([ 'ID' => [ 'type' => Type::nonNull(Type::id()), 'description' => 'The ID of the record to copy', ], 'FromVersion' => [ 'type' => Type::int(), 'description' => 'The source version number to copy.' ], 'FromStage' => [ 'type' => $this->manager->getType('VersionedStage'), 'description' => 'The source stage to copy', ], 'ToStage' => [ 'type' => Type::nonNull($this->manager->getType('VersionedStage')), 'description' => 'The destination stage to copy to', ], ]); } } |