mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-01 10:28:40 +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) {
|
foreach (static::$hasMany as $member => $rel) {
|
||||||
/* is a has many property */
|
/* is a has many property */
|
||||||
$property = $reflectionClass->getProperty($member); // throws ReflectionException
|
$property = $reflectionClass->getProperty($member); // throws ReflectionException
|
||||||
|
|
||||||
|
if(!($isPublic = $property->isPublic())) {
|
||||||
|
$property->setAccessible(true);
|
||||||
|
}
|
||||||
|
|
||||||
$values = $property->getValue($obj);
|
$values = $property->getValue($obj);
|
||||||
$temp = end($values);
|
$temp = end($values);
|
||||||
reset($values);
|
reset($values);
|
||||||
$pname = $property->getName();
|
$pname = $property->getName();
|
||||||
|
|
||||||
|
if(!($isPublic)) {
|
||||||
|
$property->setAccessible(false);
|
||||||
|
}
|
||||||
|
|
||||||
if (is_object($temp)) {
|
if (is_object($temp)) {
|
||||||
// todo: only create if object doesn't exists... get primaryKey field, then get member name based on this
|
// 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.
|
// now check if id is null or set.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user