mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-10-24 11:39:21 +02:00
34 lines
623 B
PHP
34 lines
623 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\GraphQL\Definition\Fields\Base;
|
|
|
|
use App\GraphQL\Definition\Fields\IntField;
|
|
|
|
/**
|
|
* Class IdField.
|
|
*/
|
|
class IdField extends IntField
|
|
{
|
|
/**
|
|
* Initializes the IdField with an optional custom column name.
|
|
*
|
|
* @param string $column
|
|
*/
|
|
public function __construct(protected string $column = 'id')
|
|
{
|
|
parent::__construct($column, 'id', false);
|
|
}
|
|
|
|
/**
|
|
* The description of the field.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function description(): string
|
|
{
|
|
return 'The primary key of the resource';
|
|
}
|
|
}
|