Last active
July 8, 2016 16:58
-
-
Save TorbenKoehn/d22cf4e537bbc85ca774b54a6993ae03 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Column implements Annotation | |
{ | |
private string $type; | |
private int $length; | |
private bool $nullable; | |
public function __construct(string $type, int $length = null, bool $nullable = false) | |
{ | |
$this->type = $type; | |
$this->length = $length; | |
} | |
public function getType(): string | |
{ | |
return $this->type; | |
} | |
public function getLength(): int | |
{ | |
return $this->length; | |
} | |
public function isNullable() | |
{ | |
return $this->nullable; | |
} | |
} | |
<<Entity("users")>> | |
class User | |
{ | |
<<Id>> | |
private string $id; | |
<<Column("string", 50), Assert\IsAlphaNumeric, Assert\Between(0, 100)>> | |
private string $name; | |
<<Column("string", nullable=true, length=100)>> | |
private string $slug; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment