- Work done on Join and using the @Relation annotation in case there is no join.

- Added some field type (date, Datetime, Time)
- Added a new @Filter annotation which allows to filter repository from relation into a method.
This commit is contained in:
mcndave committed 2021-01-26 16:48:40 +00:00
1 parent 65de1dd849
commit e465ecdf32
17 files changed
+197 -61

No files matched your search

+12 -1
View File
@@ -3,6 +3,7 @@
namespace Ulmus\Migration;
use Ulmus\Annotation\Property\Field;
use Ulmus\Entity;
class FieldDefinition {
@@ -28,7 +29,6 @@ class FieldDefinition {
$this->builtIn = $data['builtin'];
$this->tags = $data['tags'];
$field = $this->getFieldTag();
$this->type = $field->type ?? $data['type'];
$this->length = $field->length ?? null;
@@ -45,8 +45,19 @@ class FieldDefinition {
public function getSqlType(bool $typeOnly = false) : string
{
$type = $this->type;
$length = $this->length;
if ( is_a($type, Entity\Field\Date::class, true) ) {
$type = "DATE";
}
elseif ( is_a($type, Entity\Field\Time::class, true) ) {
$type = "TIME";
}
elseif ( is_a($type, \DateTime::class, true) ) {
$type = "DATETIME";
}
switch($type) {
case "bool":
$type = "TINYINT";