type fixes
This commit is contained in:
@@ -43,9 +43,9 @@ class Converter
|
||||
|
||||
private $config;
|
||||
|
||||
private $ormConverter;
|
||||
private Orm\Converter $ormConverter;
|
||||
|
||||
public function __construct(Metadata $metadata, FileManager $fileManager, Config $config = null)
|
||||
public function __construct(Metadata $metadata, FileManager $fileManager, ?Config $config = null)
|
||||
{
|
||||
$this->metadata = $metadata;
|
||||
$this->fileManager = $fileManager;
|
||||
@@ -53,16 +53,19 @@ class Converter
|
||||
$this->ormConverter = new Orm\Converter($this->metadata, $this->fileManager, $this->config);
|
||||
}
|
||||
|
||||
protected function getMetadata()
|
||||
protected function getMetadata(): Metadata
|
||||
{
|
||||
return $this->metadata;
|
||||
}
|
||||
|
||||
protected function getOrmConverter()
|
||||
protected function getOrmConverter(): Orm\Converter
|
||||
{
|
||||
return $this->ormConverter;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string,mixed>
|
||||
*/
|
||||
public function process()
|
||||
{
|
||||
$data = $this->getOrmConverter()->process();
|
||||
|
||||
@@ -35,11 +35,17 @@ class BoolType extends BooleanType
|
||||
{
|
||||
const BOOL = 'bool';
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return self::BOOL;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public static function getDbTypeName()
|
||||
{
|
||||
return 'TINYINT';
|
||||
|
||||
@@ -35,14 +35,19 @@ class PasswordType extends StringType
|
||||
{
|
||||
const PASSWORD = 'password';
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return self::PASSWORD;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public static function getDbTypeName()
|
||||
{
|
||||
return 'VARCHAR';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,11 +33,18 @@ use Doctrine\DBAL\Platforms\AbstractPlatform;
|
||||
|
||||
class TextType extends \Doctrine\DBAL\Types\TextType
|
||||
{
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public static function getDbTypeName()
|
||||
{
|
||||
return 'mediumtext';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string,mixed> $fieldDeclaration
|
||||
* @return string
|
||||
*/
|
||||
public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
|
||||
{
|
||||
return 'MEDIUMTEXT';
|
||||
|
||||
@@ -36,8 +36,11 @@ use Doctrine\DBAL\{
|
||||
|
||||
trait Comparator
|
||||
{
|
||||
/*
|
||||
/**
|
||||
* Fix problem with executing query for custom types
|
||||
*
|
||||
* @param string[] $changedProperties
|
||||
* @return void
|
||||
*/
|
||||
protected function espoFixTypeDiff(array &$changedProperties, Column $column1, Column $column2)
|
||||
{
|
||||
@@ -60,8 +63,10 @@ trait Comparator
|
||||
$changedProperties[] = 'type';
|
||||
}
|
||||
}
|
||||
/* Espo: end */
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
private function getColumnDbType(Column $column)
|
||||
{
|
||||
$dbType = $column->getType()->getName();
|
||||
@@ -73,6 +78,9 @@ trait Comparator
|
||||
return strtoupper($dbType);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ?int
|
||||
*/
|
||||
private function getColumnDbLength(Column $column)
|
||||
{
|
||||
$dbType = $this->getColumnDbType($column);
|
||||
@@ -87,5 +95,7 @@ trait Comparator
|
||||
if (defined($constName)) {
|
||||
return constant($constName);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user