mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-22 06:18:41 +00:00
minor structure optimizations
This commit is contained in:
parent
843d97c632
commit
f9e71e5a9e
|
|
@ -955,11 +955,7 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
$mapper = static::$ownsOne[$propertyName]['mapper'];
|
||||
$primaryKey = $obj[static::$columns[static::$primaryField]['internal']];
|
||||
|
||||
if (empty($primaryKey)) {
|
||||
return $mapper::createArray($obj);
|
||||
}
|
||||
|
||||
return $primaryKey;
|
||||
return empty($primaryKey) ? $mapper::createArray($obj) : $primaryKey;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -984,11 +980,7 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
$mapper = static::$belongsTo[$propertyName]['mapper'];
|
||||
$primaryKey = $mapper::getObjectId($obj);
|
||||
|
||||
if (empty($primaryKey)) {
|
||||
return $mapper::create($obj);
|
||||
}
|
||||
|
||||
return $primaryKey;
|
||||
return empty($primaryKey) ? $mapper::create($obj) : $primaryKey;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1009,11 +1001,7 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
$mapper = static::$belongsTo[$propertyName]['mapper'];
|
||||
$primaryKey = $obj[static::$columns[static::$primaryField]['internal']];
|
||||
|
||||
if (empty($primaryKey)) {
|
||||
return $mapper::createArray($obj);
|
||||
}
|
||||
|
||||
return $primaryKey;
|
||||
return empty($primaryKey) ? $mapper::createArray($obj) : $primaryKey;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1598,7 +1586,6 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
}
|
||||
|
||||
self::updateModel($obj, $objId, $refClass, $depth);
|
||||
|
||||
self::clear();
|
||||
|
||||
return $objId;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user