private function getMutatorMethod($class, $property)
    {
        $ucProperty = ucfirst($property);

        foreach (self::$mutatorPrefixes as $prefix) {
            try {
                $reflectionMethod = new \ReflectionMethod($class, $prefix.$ucProperty);

                // Parameter can be optional to allow things like: method(array $foo = null)
                if ($reflectionMethod->getNumberOfParameters() >= 1) {
                    return array($reflectionMethod, $prefix);
                }
            } catch (\ReflectionException $reflectionException) {
                // Try the next prefix if the method doesn't exist
            }
        }
    }
private function getMutatorMethod($class, $property)
    {
        $ucProperty = ucfirst($property);

        foreach (self::$mutatorPrefixes as $prefix) {
            try {
                $reflectionMethod = new \ReflectionMethod($class, $prefix.$ucProperty);

                // Parameter can be optional to allow things like: method(array $foo = null)
                if ($reflectionMethod->getNumberOfParameters() >= 1) {
                    return array($reflectionMethod, $prefix);
                }
            } catch (\ReflectionException $reflectionException) {
                // Try the next prefix if the method doesn't exist
            }
        }
    }
private function getMutatorMethod ( $ class , $ property ) { $ ucProperty = ucfirst ( $ property ) ; foreach ( self :: $ mutatorPrefixes as $ prefix ) { try { $ reflectionMethod = new \ ReflectionMethod ( $ class , $ prefix . $ ucProperty ) ; // Parameter can be optional to allow things like: method(array $foo = null) if ( $ reflectionMethod -> getNumberOfParameters ( ) >= 1 ) { return array ( $ reflectionMethod , $ prefix ) ; } } catch ( \ ReflectionException $ reflectionException ) { // Try the next prefix if the method doesn't exist } } }
Gets the mutator method.

Returns an array with a the instance of \ReflectionMethod as first key
and the prefix of the method as second or null if not found.

@param string $class
@param string $property

@return array
Gets the mutator method .