public function restore(array $settings = array())
    {
        $settings = array_values($settings);

        $reflection = new ReflectionMethod(get_class($this), '__construct');
        $alreadySet = $reflection->getNumberOfParameters();

        $index = 0;

        foreach($this->settings as &$setting)
        {
            if($alreadySet > $index)
            {
                continue;
            }

            if(array_key_exists($index, $settings))
            {
                $setting = $settings[$index] === '' ? NULL : $settings[$index];
            }

            $index++;
        }
    }
public function restore(array $settings = array())
    {
        $settings = array_values($settings);

        $reflection = new ReflectionMethod(get_class($this), '__construct');
        $alreadySet = $reflection->getNumberOfParameters();

        $index = 0;

        foreach($this->settings as &$setting)
        {
            if($alreadySet > $index)
            {
                continue;
            }

            if(array_key_exists($index, $settings))
            {
                $setting = $settings[$index] === '' ? NULL : $settings[$index];
            }

            $index++;
        }
    }
public function restore ( array $ settings = array ( ) ) { $ settings = array_values ( $ settings ) ; $ reflection = new ReflectionMethod ( get_class ( $ this ) , '__construct' ) ; $ alreadySet = $ reflection -> getNumberOfParameters ( ) ; $ index = 0 ; foreach ( $ this -> settings as & $ setting ) { if ( $ alreadySet > $ index ) { continue ; } if ( array_key_exists ( $ index , $ settings ) ) { $ setting = $ settings [ $ index ] === '' ? NULL : $ settings [ $ index ] ; } $ index ++ ; } }
Restore effect state from array
@param array $settings
Restore effect state from array