mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 17:58:41 +00:00
Accessibility check fix
This commit is contained in:
parent
7c4a25db72
commit
309641f6fe
|
|
@ -272,11 +272,20 @@ abstract class DataMapperAbstract implements DataMapperInterface
|
|||
foreach (static::$hasMany as $member => $rel) {
|
||||
/* is a has many property */
|
||||
$property = $reflectionClass->getProperty($member); // throws ReflectionException
|
||||
|
||||
if(!($isPublic = $property->isPublic())) {
|
||||
$property->setAccessible(true);
|
||||
}
|
||||
|
||||
$values = $property->getValue($obj);
|
||||
$temp = end($values);
|
||||
reset($values);
|
||||
$pname = $property->getName();
|
||||
|
||||
if(!($isPublic)) {
|
||||
$property->setAccessible(false);
|
||||
}
|
||||
|
||||
if (is_object($temp)) {
|
||||
// todo: only create if object doesn't exists... get primaryKey field, then get member name based on this
|
||||
// now check if id is null or set.
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user