protected function collectValue($object, XPClass $class, $methodName, &$value) { if (!$class->hasMethod($methodName)) { return FALSE; } $method = $class->getMethod($methodName); if (!($method->getModifiers() & MODIFIER_PUBLIC)) { return FALSE; } if ($method->numParameters() > 0) { $parameter = $method->getParameter(0); if (!$parameter->isOptional()) { return FALSE; } } try { $value = $method->invoke($object); return TRUE; } catch (Exception $exc) { } return FALSE; }