mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-10 22:18:40 +00:00
Bugfix if object already exists
This commit is contained in:
parent
820f079ca4
commit
4fed8e5a46
|
|
@ -1498,6 +1498,8 @@ class DataMapperAbstract implements DataMapperInterface
|
||||||
|
|
||||||
foreach ($primaryKey as $key => $value) {
|
foreach ($primaryKey as $key => $value) {
|
||||||
if(self::isInitialized(static::class, $value)) {
|
if(self::isInitialized(static::class, $value)) {
|
||||||
|
$obj[$value] = self::getInitialized(static::class, $value);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1911,6 +1913,21 @@ class DataMapperAbstract implements DataMapperInterface
|
||||||
{
|
{
|
||||||
return isset(self::$initObjects[$mapper]) && isset(self::$initObjects[$mapper][$id]);
|
return isset(self::$initObjects[$mapper]) && isset(self::$initObjects[$mapper][$id]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get initialized object
|
||||||
|
*
|
||||||
|
* @param string $mapper Mapper name
|
||||||
|
* @param mixed $id Object id
|
||||||
|
*
|
||||||
|
* @return object
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
private static function getInitialized($mapper, $id)
|
||||||
|
{
|
||||||
|
return self::$initObjects[$mapper][$id];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Define the highest mapper of this request
|
* Define the highest mapper of this request
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user