Skip to content

Commit

Permalink
Merge branch 'master' of github.com:mevdschee/php-crud-api
Browse files Browse the repository at this point in the history
  • Loading branch information
mevdschee committed Sep 11, 2019
2 parents fb7e111 + c070579 commit 96ede40
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
13 changes: 7 additions & 6 deletions api.php
Original file line number Diff line number Diff line change
Expand Up @@ -3619,11 +3619,11 @@ public static function fromJson(/* object */$json): ReflectedColumn
{
$name = $json->name;
$type = $json->type;
$length = isset($json->length) ? $json->length : 0;
$precision = isset($json->precision) ? $json->precision : 0;
$scale = isset($json->scale) ? $json->scale : 0;
$nullable = isset($json->nullable) ? $json->nullable : false;
$pk = isset($json->pk) ? $json->pk : false;
$length = isset($json->length) ? (int) $json->length : 0;
$precision = isset($json->precision) ? (int) $json->precision : 0;
$scale = isset($json->scale) ? (int) $json->scale : 0;
$nullable = isset($json->nullable) ? (bool) $json->nullable : false;
$pk = isset($json->pk) ? (bool) $json->pk : false;
$fk = isset($json->fk) ? $json->fk : '';
return new ReflectedColumn($name, $type, $length, $precision, $scale, $nullable, $pk, $fk);
}
Expand Down Expand Up @@ -6297,6 +6297,7 @@ public function __construct(string $driver)
'smallint' => 'integer',
'real' => 'float',
'numeric' => 'decimal',
'nclob' => 'clob',
'time_with_timezone' => 'time',
'timestamp_with_timezone' => 'timestamp',
],
Expand Down Expand Up @@ -6389,7 +6390,7 @@ public function __construct(string $driver)
//'datalink' => true,
'date' => true,
'decimal' => true,
'distinct' => true,
//'distinct' => true,
'double' => true,
'float' => true,
'integer' => true,
Expand Down
10 changes: 5 additions & 5 deletions src/Tqdev/PhpCrudApi/Column/Reflection/ReflectedColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ public static function fromJson(/* object */$json): ReflectedColumn
{
$name = $json->name;
$type = $json->type;
$length = isset($json->length) ? $json->length : 0;
$precision = isset($json->precision) ? $json->precision : 0;
$scale = isset($json->scale) ? $json->scale : 0;
$nullable = isset($json->nullable) ? $json->nullable : false;
$pk = isset($json->pk) ? $json->pk : false;
$length = isset($json->length) ? (int) $json->length : 0;
$precision = isset($json->precision) ? (int) $json->precision : 0;
$scale = isset($json->scale) ? (int) $json->scale : 0;
$nullable = isset($json->nullable) ? (bool) $json->nullable : false;
$pk = isset($json->pk) ? (bool) $json->pk : false;
$fk = isset($json->fk) ? $json->fk : '';
return new ReflectedColumn($name, $type, $length, $precision, $scale, $nullable, $pk, $fk);
}
Expand Down
3 changes: 2 additions & 1 deletion src/Tqdev/PhpCrudApi/Database/TypeConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public function __construct(string $driver)
'smallint' => 'integer',
'real' => 'float',
'numeric' => 'decimal',
'nclob' => 'clob',
'time_with_timezone' => 'time',
'timestamp_with_timezone' => 'timestamp',
],
Expand Down Expand Up @@ -135,7 +136,7 @@ public function __construct(string $driver)
//'datalink' => true,
'date' => true,
'decimal' => true,
'distinct' => true,
//'distinct' => true,
'double' => true,
'float' => true,
'integer' => true,
Expand Down

0 comments on commit 96ede40

Please sign in to comment.