mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 17:58:41 +00:00
minor formatting fixes
This commit is contained in:
parent
01649f0489
commit
84fa78359b
|
|
@ -260,7 +260,6 @@ final class ReadMapper extends DataMapperAbstract
|
||||||
*/
|
*/
|
||||||
public function executeGet(?Builder $query = null) : mixed
|
public function executeGet(?Builder $query = null) : mixed
|
||||||
{
|
{
|
||||||
// Get initialized objects from memory cache.
|
|
||||||
$objs = [];
|
$objs = [];
|
||||||
$indexed = [];
|
$indexed = [];
|
||||||
|
|
||||||
|
|
@ -1206,6 +1205,8 @@ final class ReadMapper extends DataMapperAbstract
|
||||||
$relMapper = $this->createRelationMapper($relation['mapper']::reader($this->db), $member);
|
$relMapper = $this->createRelationMapper($relation['mapper']::reader($this->db), $member);
|
||||||
|
|
||||||
$isPrivate = $relation['private'] ?? false;
|
$isPrivate = $relation['private'] ?? false;
|
||||||
|
$tempObjs = [];
|
||||||
|
|
||||||
if ($isPrivate) {
|
if ($isPrivate) {
|
||||||
if ($refClass === null) {
|
if ($refClass === null) {
|
||||||
$refClass = new \ReflectionClass($obj);
|
$refClass = new \ReflectionClass($obj);
|
||||||
|
|
@ -1213,23 +1214,19 @@ final class ReadMapper extends DataMapperAbstract
|
||||||
|
|
||||||
$refProp = $refClass->getProperty($member);
|
$refProp = $refClass->getProperty($member);
|
||||||
|
|
||||||
$tempObjs = [];
|
|
||||||
foreach ($objs as $obj) {
|
foreach ($objs as $obj) {
|
||||||
$tempObjs[] = $refProp->getValue($obj);
|
$tempObjs[] = $refProp->getValue($obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
$relMapper->loadHasManyRelations($tempObjs);
|
|
||||||
} else {
|
} else {
|
||||||
$tempObjs = [];
|
|
||||||
foreach ($objs as $obj) {
|
foreach ($objs as $obj) {
|
||||||
$tempObjs[] = $obj->{$member};
|
$tempObjs[] = $obj->{$member};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$relMapper->loadHasManyRelations($tempObjs);
|
$relMapper->loadHasManyRelations($tempObjs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if object has certain relations
|
* Checks if object has certain relations
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user