fix db bugs

This commit is contained in:
Dennis Eichhorn 2020-03-28 17:16:05 +01:00
parent 7300b52d25
commit e83574a452
6 changed files with 38 additions and 34 deletions

View File

@ -1885,7 +1885,9 @@ class DataMapperAbstract implements DataMapperInterface
if ($depth < 1) {
if (\array_key_exists(static::$ownsOne[$member]['self'] . '_' . ($depth + 1), $result)) {
return $mapper::createNullModel($result[static::$ownsOne[$member]['self'] . '_' . ($depth + 1)]);
return isset(static::$ownsOne[$member]['column'])
? $result[static::$ownsOne[$member]['self'] . '_' . ($depth + 1)]
: $mapper::createNullModel($result[static::$ownsOne[$member]['self'] . '_' . ($depth + 1)]);
} else {
return $default;
}
@ -1963,7 +1965,9 @@ class DataMapperAbstract implements DataMapperInterface
if ($depth < 1) {
if (\array_key_exists(static::$belongsTo[$member]['self'] . '_' . ($depth + 1), $result)) {
return $mapper::createNullModel($result[static::$belongsTo[$member]['self'] . '_' . ($depth + 1)]);
return isset(static::$belongsTo[$member]['column'])
? $result[static::$belongsTo[$member]['self'] . '_' . ($depth + 1)]
: $mapper::createNullModel($result[static::$belongsTo[$member]['self'] . '_' . ($depth + 1)]);
} else {
return $default;
}

View File

@ -30,7 +30,7 @@ class City
* @var int
* @since 1.0.0
*/
private int $id = 0;
protected int $id = 0;
/**
* Country code.
@ -38,7 +38,7 @@ class City
* @var string
* @since 1.0.0
*/
private string $countryCode = '';
protected string $countryCode = '';
/**
* State code.
@ -46,7 +46,7 @@ class City
* @var string
* @since 1.0.0
*/
private string $state = '';
protected string $state = '';
/**
* City name.
@ -54,7 +54,7 @@ class City
* @var string
* @since 1.0.0
*/
private string $name = '';
protected string $name = '';
/**
* Postal code.
@ -62,7 +62,7 @@ class City
* @var int
* @since 1.0.0
*/
private int $postal = 0;
protected int $postal = 0;
/**
* Latitude.
@ -70,7 +70,7 @@ class City
* @var float
* @since 1.0.0
*/
private float $lat = 0.0;
protected float $lat = 0.0;
/**
* Longitude.
@ -78,7 +78,7 @@ class City
* @var float
* @since 1.0.0
*/
private float $long = 0.0;
protected float $long = 0.0;
/**
* Get city name

View File

@ -30,7 +30,7 @@ class Country
* @var int
* @since 1.0.0
*/
private $id = 0;
protected int $id = 0;
/**
* Country name.
@ -38,7 +38,7 @@ class Country
* @var string
* @since 1.0.0
*/
private $name = '';
protected string $name = '';
/**
* Country code.
@ -46,7 +46,7 @@ class Country
* @var string
* @since 1.0.0
*/
private $code2 = '';
protected string $code2 = '';
/**
* Country code.
@ -54,7 +54,7 @@ class Country
* @var string
* @since 1.0.0
*/
private $code3 = '';
protected string $code3 = '';
/**
* Country code.
@ -62,7 +62,7 @@ class Country
* @var int
* @since 1.0.0
*/
private $numeric = 0;
protected int $numeric = 0;
/**
* Country subdevision.
@ -70,7 +70,7 @@ class Country
* @var string
* @since 1.0.0
*/
private $subdevision = '';
protected string $subdevision = '';
/**
* Get id

View File

@ -30,7 +30,7 @@ class Currency
* @var int
* @since 1.0.0
*/
private int $id = 0;
protected int $id = 0;
/**
* Currency name.
@ -38,7 +38,7 @@ class Currency
* @var string
* @since 1.0.0
*/
private string $name = '';
protected string $name = '';
/**
* Currency code.
@ -46,7 +46,7 @@ class Currency
* @var string
* @since 1.0.0
*/
private string $code = '';
protected string $code = '';
/**
* Currency symbol.
@ -54,7 +54,7 @@ class Currency
* @var string
* @since 1.0.0
*/
private string $symbol = '';
protected string $symbol = '';
/**
* Currency number.
@ -62,7 +62,7 @@ class Currency
* @var string
* @since 1.0.0
*/
private string $number = '';
protected string $number = '';
/**
* Currency subunits.
@ -70,7 +70,7 @@ class Currency
* @var int
* @since 1.0.0
*/
private int $subunits = 0;
protected int $subunits = 0;
/**
* Currency decimals.
@ -78,7 +78,7 @@ class Currency
* @var string
* @since 1.0.0
*/
private string $decimals = '';
protected string $decimals = '';
/**
* Currency countries.
@ -86,7 +86,7 @@ class Currency
* @var string
* @since 1.0.0
*/
private string $countries = '';
protected string $countries = '';
/**
* Get currency name

View File

@ -30,7 +30,7 @@ class Iban
* @var int
* @since 1.0.0
*/
private $id = 0;
protected int $id = 0;
/**
* Iban country.
@ -38,7 +38,7 @@ class Iban
* @var string
* @since 1.0.0
*/
private $country = '';
protected string $country = '';
/**
* Iban chars.
@ -46,7 +46,7 @@ class Iban
* @var int
* @since 1.0.0
*/
private $chars = 2;
protected int $chars = 2;
/**
* Iban bban.
@ -54,7 +54,7 @@ class Iban
* @var string
* @since 1.0.0
*/
private $bban = '';
protected string $bban = '';
/**
* Iban fields.
@ -62,7 +62,7 @@ class Iban
* @var string
* @since 1.0.0
*/
private $fields = '';
protected string $fields = '';
/**
* Get iban country

View File

@ -30,7 +30,7 @@ class Language
* @var int
* @since 1.0.0
*/
private int $id = 0;
protected int $id = 0;
/**
* Language name.
@ -38,7 +38,7 @@ class Language
* @var string
* @since 1.0.0
*/
private string $name = '';
protected string $name = '';
/**
* Language native.
@ -46,7 +46,7 @@ class Language
* @var string
* @since 1.0.0
*/
private string $native = '';
protected string $native = '';
/**
* Language code.
@ -54,7 +54,7 @@ class Language
* @var string
* @since 1.0.0
*/
private string $code2 = '';
protected string $code2 = '';
/**
* Language code.
@ -62,7 +62,7 @@ class Language
* @var string
* @since 1.0.0
*/
private string $code3 = '';
protected string $code3 = '';
/**
* Language code.
@ -70,7 +70,7 @@ class Language
* @var string
* @since 1.0.0
*/
private string $code3Native = '';
protected string $code3Native = '';
/**
* Get id