mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-09-04 03:35:02 +02:00
36 lines
672 B
PHP
36 lines
672 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Http\Api\Field;
|
|
|
|
use App\Contracts\Http\Api\Field\FieldInterface;
|
|
use App\Http\Api\Schema\Schema;
|
|
|
|
abstract class Field implements FieldInterface
|
|
{
|
|
public function __construct(
|
|
protected readonly Schema $schema,
|
|
protected readonly string $key,
|
|
protected readonly ?string $column = null
|
|
) {}
|
|
|
|
public function schema(): Schema
|
|
{
|
|
return $this->schema;
|
|
}
|
|
|
|
public function getKey(): string
|
|
{
|
|
return $this->key;
|
|
}
|
|
|
|
/**
|
|
* Get the field column.
|
|
*/
|
|
public function getColumn(): ?string
|
|
{
|
|
return $this->column ?? $this->key;
|
|
}
|
|
}
|