Skip to content

Commit

Permalink
Add default scalar types into column, field and rule creators
Browse files Browse the repository at this point in the history
  • Loading branch information
jzaplet committed Oct 1, 2024
1 parent 8ade887 commit 8eac2b0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Collection/Helper/ColumnCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public static function create(string $type, string $key, bool $visible, bool $so

Types::BLOB => new BlobColumn(key: $key, name: $key, sortable: $sortable, visible: $visible),

'bool',
Types::BOOLEAN => new BooleanColumn(key: $key, name: $key, sortable: $sortable, visible: $visible),

Types::DATE_MUTABLE,
Expand Down
2 changes: 2 additions & 0 deletions src/Collection/Helper/FieldCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@ public static function create(WriteBuilder $builder, string $columnType, string
Types::DECIMAL,
Types::FLOAT => new DecimalField($name, $name, defaultValue: $defaultValue),

'int',
Types::INTEGER,
Types::SMALLINT => new IntegerField($name, $name, defaultValue: $defaultValue),

'bool',
Types::BOOLEAN => new ToggleBtnField($name, $name, defaultValue: $defaultValue),

Types::DATE_MUTABLE,
Expand Down
2 changes: 2 additions & 0 deletions src/Collection/Helper/RuleCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public static function create(string $columnType): ?IRule
Types::DECIMAL,
Types::FLOAT => new DecimalRule(),

'bool',
Types::BOOLEAN => new BooleanRule(),

Types::DATE_MUTABLE,
Expand All @@ -48,6 +49,7 @@ public static function create(string $columnType): ?IRule
Types::DATETIMETZ_MUTABLE,
Types::DATETIMETZ_IMMUTABLE => new DateTimeRule(),

'int',
Types::INTEGER,
Types::SMALLINT => new IntegerRule(),

Expand Down

0 comments on commit 8eac2b0

Please sign in to comment.