modelData as $key => $val) { $result = $this->getSimpleValue($val); if ($result !== null) { $object->$key = $this->nullPlaceholderCheck($result); } } // Process all public properties. $reflect = new ReflectionObject($this); $props = $reflect->getProperties(ReflectionProperty::IS_PUBLIC); foreach ($props as $member) { $name = $member->getName(); $result = $this->getSimpleValue($this->$name); if ($result !== null) { $name = $this->getMappedName($name); $object->$name = $this->nullPlaceholderCheck($result); } } return $object; }