mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-10 05:58:42 +00:00
fix delete bug
This commit is contained in:
parent
77bbb3f7a7
commit
ef2ad3d19f
|
|
@ -1824,6 +1824,7 @@ class DataMapperAbstract implements DataMapperInterface
|
||||||
*/
|
*/
|
||||||
public static function delete($obj, int $relations = RelationType::REFERENCE)
|
public static function delete($obj, int $relations = RelationType::REFERENCE)
|
||||||
{
|
{
|
||||||
|
// @todo: only do this if RelationType !== NONE
|
||||||
if (\is_scalar($obj)) {
|
if (\is_scalar($obj)) {
|
||||||
$obj = static::get($obj);
|
$obj = static::get($obj);
|
||||||
}
|
}
|
||||||
|
|
@ -3373,11 +3374,11 @@ class DataMapperAbstract implements DataMapperInterface
|
||||||
*/
|
*/
|
||||||
private static function removeInitialized(string $mapper, $id)
|
private static function removeInitialized(string $mapper, $id)
|
||||||
{
|
{
|
||||||
if (self::isInitialized($mapper, $id)) {
|
if (isset(self::$initObjects[$mapper][$id])) {
|
||||||
unset(self::$initObjects[$mapper][$id]);
|
unset(self::$initObjects[$mapper][$id]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self::isInitializedArray($mapper, $id)) {
|
if (isset(self::$initArrays[$mapper][$id])) {
|
||||||
unset(self::$initArrays[$mapper][$id]);
|
unset(self::$initArrays[$mapper][$id]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user