Source of file FileInputTypeCreator.php
Size: 1,404 Bytes - Last Modified: 2021-12-23T10:27:34+00:00
/var/www/docs.ssmods.com/process/src/_legacy/GraphQL/FileInputTypeCreator.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 | <?php namespace SilverStripe\AssetAdmin\GraphQL; use SilverStripe\GraphQL\Util\CaseInsensitiveFieldAccessor; use GraphQL\Type\Definition\Type; use SilverStripe\GraphQL\TypeCreator; use SilverStripe\GraphQL\Manager; if (!class_exists(TypeCreator::class)) { return; } /** * @todo Allow setting of Owner and ShowInSearch fields * @deprecated 4.8..5.0 Use silverstripe/graphql:^4 functionality. */ class FileInputTypeCreator extends TypeCreator { /** * @var CaseInsensitiveFieldAccessor */ protected $accessor; protected $inputObject = true; public function __construct(Manager $manager = null) { $this->accessor = new CaseInsensitiveFieldAccessor(); parent::__construct($manager); } public function attributes() { return [ 'name' => 'FileInput', 'description' => 'Input type for files and images', ]; } public function fields() { return [ 'parentId' => [ 'type' => Type::nonNull(Type::int()), ], 'title' => [ 'type' => Type::string(), ], 'name' => [ 'type' => Type::string(), ], ]; } public function resolveField($object, array $args, $context, $info) { return $this->accessor->getValue($object, $info->fieldName); } } |