src/Rails/ActiveModel/Attributes/AccessibleProperties.php
protected function getAccessibleProperties($className)
    {
        $refl = $className::getReflection();
        $props = [];
        
        foreach ($refl->getProperties() as $prop) {
            if (
                $prop->getDeclaringClass()->getName() == 'Rails\ActiveModel\Base'           ||
                $prop->getDeclaringClass()->getName() == 'Rails\ActiveRecord\Base'          ||
                $prop->getDeclaringClass()->getName() == 'Rails\ActiveRecord\Mongo\Base'
            ) {
                break;
            }
            
            if ($prop->isPublic()) {
                $props[$prop->getName()] = [
                    'propName' => $prop->getName()
                ];
            } else {
                $params = [];
                
                $getterMethodName = $prop->getName();
                if (
                    $refl->hasMethod($getterMethodName) &&
                    ($method = $refl->getMethod($getterMethodName)) &&
                    $method->isPublic()
                ) {
                    $params[] = $getterMethodName;
                } else {
                    $params[] = false;
                }
                
                $setterMethodName = 'set' . ucfirst($prop->getName());
                if (
                    $refl->hasMethod($setterMethodName) &&
                    ($method = $refl->getMethod($setterMethodName)) &&
                    $method->isPublic()
                ) {
                    $params[] = $setterMethodName;
                } else {
                    $params[] = false;
                }
                
                $props[$prop->getName()] = $params;
            }
        }
        
        return $props;
    }
protected function getAccessibleProperties($className)
    {
        $refl = $className::getReflection();
        $props = [];
        
        foreach ($refl->getProperties() as $prop) {
            if (
                $prop->getDeclaringClass()->getName() == 'Rails\ActiveModel\Base'           ||
                $prop->getDeclaringClass()->getName() == 'Rails\ActiveRecord\Base'          ||
                $prop->getDeclaringClass()->getName() == 'Rails\ActiveRecord\Mongo\Base'
            ) {
                break;
            }
            
            if ($prop->isPublic()) {
                $props[$prop->getName()] = [
                    'propName' => $prop->getName()
                ];
            } else {
                $params = [];
                
                $getterMethodName = $prop->getName();
                if (
                    $refl->hasMethod($getterMethodName) &&
                    ($method = $refl->getMethod($getterMethodName)) &&
                    $method->isPublic()
                ) {
                    $params[] = $getterMethodName;
                } else {
                    $params[] = false;
                }
                
                $setterMethodName = 'set' . ucfirst($prop->getName());
                if (
                    $refl->hasMethod($setterMethodName) &&
                    ($method = $refl->getMethod($setterMethodName)) &&
                    $method->isPublic()
                ) {
                    $params[] = $setterMethodName;
                } else {
                    $params[] = false;
                }
                
                $props[$prop->getName()] = $params;
            }
        }
        
        return $props;
    }
protected function getAccessibleProperties ( $ className ) { $ refl = $ className :: getReflection ( ) ; $ props = [ ] ; foreach ( $ refl -> getProperties ( ) as $ prop ) { if ( $ prop -> getDeclaringClass ( ) -> getName ( ) == 'Rails\ActiveModel\Base' || $ prop -> getDeclaringClass ( ) -> getName ( ) == 'Rails\ActiveRecord\Base' || $ prop -> getDeclaringClass ( ) -> getName ( ) == 'Rails\ActiveRecord\Mongo\Base' ) { break ; } if ( $ prop -> isPublic ( ) ) { $ props [ $ prop -> getName ( ) ] = [ 'propName' => $ prop -> getName ( ) ] ; } else { $ params = [ ] ; $ getterMethodName = $ prop -> getName ( ) ; if ( $ refl -> hasMethod ( $ getterMethodName ) && ( $ method = $ refl -> getMethod ( $ getterMethodName ) ) && $ method -> isPublic ( ) ) { $ params [ ] = $ getterMethodName ; } else { $ params [ ] = false ; } $ setterMethodName = 'set' . ucfirst ( $ prop -> getName ( ) ) ; if ( $ refl -> hasMethod ( $ setterMethodName ) && ( $ method = $ refl -> getMethod ( $ setterMethodName ) ) && $ method -> isPublic ( ) ) { $ params [ ] = $ setterMethodName ; } else { $ params [ ] = false ; } $ props [ $ prop -> getName ( ) ] = $ params ; } } return $ props ; }
Get accessible properties.
An accessible property is either a public property, or a
property that has a setter method named like `setPropName`.
Returns an array whose keys are the property name, and the value
is the setter name if the property has a setter, or an array with
the actual property name under the `propName` key if its a public
property.

@param string $className
@return array
Get accessible properties . An accessible property is either a public property or a property that has a setter method named like setPropName . Returns an array whose keys are the property name and the value is the setter name if the property has a setter or an array with the actual property name under the propName key if its a public property .