mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-12 14:58:42 +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'];
|
$mapper = static::$ownsOne[$propertyName]['mapper'];
|
||||||
$primaryKey = $obj[static::$columns[static::$primaryField]['internal']];
|
$primaryKey = $obj[static::$columns[static::$primaryField]['internal']];
|
||||||
|
|
||||||
if (empty($primaryKey)) {
|
return empty($primaryKey) ? $mapper::createArray($obj) : $primaryKey;
|
||||||
return $mapper::createArray($obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $primaryKey;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -984,11 +980,7 @@ class DataMapperAbstract implements DataMapperInterface
|
||||||
$mapper = static::$belongsTo[$propertyName]['mapper'];
|
$mapper = static::$belongsTo[$propertyName]['mapper'];
|
||||||
$primaryKey = $mapper::getObjectId($obj);
|
$primaryKey = $mapper::getObjectId($obj);
|
||||||
|
|
||||||
if (empty($primaryKey)) {
|
return empty($primaryKey) ? $mapper::create($obj) : $primaryKey;
|
||||||
return $mapper::create($obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $primaryKey;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -1009,11 +1001,7 @@ class DataMapperAbstract implements DataMapperInterface
|
||||||
$mapper = static::$belongsTo[$propertyName]['mapper'];
|
$mapper = static::$belongsTo[$propertyName]['mapper'];
|
||||||
$primaryKey = $obj[static::$columns[static::$primaryField]['internal']];
|
$primaryKey = $obj[static::$columns[static::$primaryField]['internal']];
|
||||||
|
|
||||||
if (empty($primaryKey)) {
|
return empty($primaryKey) ? $mapper::createArray($obj) : $primaryKey;
|
||||||
return $mapper::createArray($obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $primaryKey;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -1598,7 +1586,6 @@ class DataMapperAbstract implements DataMapperInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
self::updateModel($obj, $objId, $refClass, $depth);
|
self::updateModel($obj, $objId, $refClass, $depth);
|
||||||
|
|
||||||
self::clear();
|
self::clear();
|
||||||
|
|
||||||
return $objId;
|
return $objId;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user