public static function findPropertyNameStatic($name, $object)
    {
        $property = null;
        if (property_exists($object, $name)) {
            $property = $name;
        } else {
            // _name
            $underscore_name = '_'.$name;
            if (property_exists($object, $underscore_name)) {
                $property = $underscore_name;
            } else {
                // __name
                $doubleunderscore_name = '__'.$name;
                if (property_exists($object, $doubleunderscore_name)) {
                    $property = $doubleunderscore_name;
                }
            }
        }
        return $property;
    }
public static function findPropertyNameStatic($name, $object)
    {
        $property = null;
        if (property_exists($object, $name)) {
            $property = $name;
        } else {
            // _name
            $underscore_name = '_'.$name;
            if (property_exists($object, $underscore_name)) {
                $property = $underscore_name;
            } else {
                // __name
                $doubleunderscore_name = '__'.$name;
                if (property_exists($object, $doubleunderscore_name)) {
                    $property = $doubleunderscore_name;
                }
            }
        }
        return $property;
    }
public static function findPropertyNameStatic ( $ name , $ object ) { $ property = null ; if ( property_exists ( $ object , $ name ) ) { $ property = $ name ; } else { // _name $ underscore_name = '_' . $ name ; if ( property_exists ( $ object , $ underscore_name ) ) { $ property = $ underscore_name ; } else { // __name $ doubleunderscore_name = '__' . $ name ; if ( property_exists ( $ object , $ doubleunderscore_name ) ) { $ property = $ doubleunderscore_name ; } } } return $ property ; }
Search a property name in the current object with one or tow leading underscores

@param string $name The property name to transform
@param string|object $object The object or a class name to work on
@return string The transformed property name
Search a property name in the current object with one or tow leading underscores