mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-07-27 09:14:43 +02:00
41 lines
909 B
PHP
41 lines
909 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\GraphQL\Schema\Fields;
|
|
|
|
use App\Contracts\GraphQL\Fields\DisplayableField;
|
|
use App\Contracts\GraphQL\Fields\FilterableField;
|
|
use App\Contracts\GraphQL\Fields\SortableField;
|
|
use App\Enums\GraphQL\SortType;
|
|
use App\GraphQL\Filter\FloatFilter;
|
|
use GraphQL\Type\Definition\Type;
|
|
|
|
abstract class FloatField extends Field implements DisplayableField, FilterableField, SortableField
|
|
{
|
|
public function baseType(): Type
|
|
{
|
|
return Type::float();
|
|
}
|
|
|
|
public function canBeDisplayed(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function getFilter(): FloatFilter
|
|
{
|
|
return new FloatFilter($this->getName(), $this->getColumn())
|
|
->useEq()
|
|
->useLt()
|
|
->useGt()
|
|
->useIn()
|
|
->useNotIn();
|
|
}
|
|
|
|
public function sortType(): SortType
|
|
{
|
|
return SortType::ROOT;
|
|
}
|
|
}
|