Browse Source

added `MimeType` as as a Field

pull/2/head
Cerys 4 months ago
parent
commit
25c0c96043
  1. 5
      src/SchemaBuilder/Attributes/SchemaDocumentField.php
  2. 2
      src/SchemaBuilder/SchemaBuilder.php

5
src/SchemaBuilder/Attributes/SchemaDocumentField.php

@ -16,18 +16,21 @@ class SchemaDocumentField extends Attribute
public string $Comment; public string $Comment;
public array $ValidSchemas; public array $ValidSchemas;
public int $MaxSize; public int $MaxSize;
public string $MimeType;
public function __construct( public function __construct(
string $Name, string $Name,
SchemaFieldExistence $Existence = SchemaFieldExistence::MAY, SchemaFieldExistence $Existence = SchemaFieldExistence::MAY,
string $Comment = "", string $Comment = "",
array $ValidSchemas = [], array $ValidSchemas = [],
int $MaxSize = 0 int $MaxSize = 0,
string $MimeType = "",
) )
{ {
$this->Existence = $Existence; $this->Existence = $Existence;
$this->Comment = $Comment; $this->Comment = $Comment;
$this->ValidSchemas = $ValidSchemas; $this->ValidSchemas = $ValidSchemas;
$this->MimeType = $MimeType;
parent::__construct(new Name("SchemaDocumentField"), [], []); parent::__construct(new Name("SchemaDocumentField"), [], []);
} }

2
src/SchemaBuilder/SchemaBuilder.php

@ -12,7 +12,7 @@ class SchemaBuilder
/** /**
* Goes through the Attribute classes and makes a list of all the Properties they have. * Goes through the Attribute classes and makes a list of all the Properties they have.
* This is so if a user adds another variable to the Attribute constructor, it won't appear in the final Schema. * This is so if a user adds another variable to the Attribute constructor, it won't appear in the final Schema.
* *
* @return array[] * @return array[]
*/ */
private static function GetValidKeys(): array private static function GetValidKeys(): array

Loading…
Cancel
Save