Browse Source

created the base for the Attribute classes

pull/2/head
Cerys 4 months ago
parent
commit
76cf239d88
  1. 27
      src/SchemaBuilder/Attributes/SchemaDocument.php
  2. 30
      src/SchemaBuilder/Attributes/SchemaDocumentField.php

27
src/SchemaBuilder/Attributes/SchemaDocument.php

@ -0,0 +1,27 @@
<?php
namespace Darksparrow\DeegraphPHP\SchemaBuilder\Attributes;
use PhpParser\Node\Attribute;
use ReflectionClass;
#[\Attribute]
class SchemaDocument extends Attribute
{
public int $MaximumSize;
public string $Comment;
public string $MIMEType;
public function __construct(
int $maxSize = 0,
string $comment = "",
string $mimeType = ""
)
{
$this->MaximumSize = $maxSize;
$this->Comment = $comment;
$this->MIMEType = $mimeType;
parent::__construct("SchemaDocument", [], []);
}
}

30
src/SchemaBuilder/Attributes/SchemaDocumentField.php

@ -0,0 +1,30 @@
<?php
namespace Darksparrow\DeegraphPHP\SchemaBuilder\Attributes;
use Darksparrow\DeegraphPHP\Enumerators\SchemaFieldExistence;
use PhpParser\Node\Attribute;
#[\Attribute]
class SchemaDocumentField extends Attribute
{
public SchemaFieldExistence $Existence;
public string $Comment;
public array $ValidSchemas;
public int $MaxSize;
public function __construct(
SchemaFieldExistence $existence,
string $comment = "",
array $validSchemas = [],
int $maxSize = 0
)
{
$this->Existence = $existence;
$this->Comment = $comment;
$this->ValidSchemas = $validSchemas;
parent::__construct("SchemaDocumentField", [], []);
}
}
Loading…
Cancel
Save