public function iSetConfigurationKeyWithValue($wrapperName, $key, $value) {
        if ($value === "false") {
            $value = false;
        } else if ($value === "true") {
            $value = true;
        }
        $configurationManager = $this->container->get($this->container->getParameter("tecnocreaciones_tools.configuration_manager.name"));
        $wrapper = $configurationManager->getWrapper($wrapperName);
        $success = false;
        if ($this->accessor->isWritable($wrapper, $key) === true) {
            $success = $this->accessor->setValue($wrapper, $key, $value);
        } else {
            $success = $configurationManager->set($key, $value, $wrapperName, null, true);
        }
        if ($success === false) {
            throw new Exception(sprintf("The value of '%s' can not be update with value '%s'.", $key, $value));
        }

        $configurationManager->flush(true);
        if ($this->accessor->isReadable($wrapper, $key)) {
            $newValue = $this->accessor->getValue($wrapper, $key);
        } else {
            $newValue = $configurationManager->get($key, $wrapperName, null);
        }

        if ($value != $newValue) {
            throw new Exception(sprintf("Failed to update '%s' key '%s' with '%s' configuration.", $wrapperName, $key, $value));
        }
    }
public function iSetConfigurationKeyWithValue($wrapperName, $key, $value) {
        if ($value === "false") {
            $value = false;
        } else if ($value === "true") {
            $value = true;
        }
        $configurationManager = $this->container->get($this->container->getParameter("tecnocreaciones_tools.configuration_manager.name"));
        $wrapper = $configurationManager->getWrapper($wrapperName);
        $success = false;
        if ($this->accessor->isWritable($wrapper, $key) === true) {
            $success = $this->accessor->setValue($wrapper, $key, $value);
        } else {
            $success = $configurationManager->set($key, $value, $wrapperName, null, true);
        }
        if ($success === false) {
            throw new Exception(sprintf("The value of '%s' can not be update with value '%s'.", $key, $value));
        }

        $configurationManager->flush(true);
        if ($this->accessor->isReadable($wrapper, $key)) {
            $newValue = $this->accessor->getValue($wrapper, $key);
        } else {
            $newValue = $configurationManager->get($key, $wrapperName, null);
        }

        if ($value != $newValue) {
            throw new Exception(sprintf("Failed to update '%s' key '%s' with '%s' configuration.", $wrapperName, $key, $value));
        }
    }
public function iSetConfigurationKeyWithValue ( $ wrapperName , $ key , $ value ) { if ( $ value === "false" ) { $ value = false ; } else if ( $ value === "true" ) { $ value = true ; } $ configurationManager = $ this -> container -> get ( $ this -> container -> getParameter ( "tecnocreaciones_tools.configuration_manager.name" ) ) ; $ wrapper = $ configurationManager -> getWrapper ( $ wrapperName ) ; $ success = false ; if ( $ this -> accessor -> isWritable ( $ wrapper , $ key ) === true ) { $ success = $ this -> accessor -> setValue ( $ wrapper , $ key , $ value ) ; } else { $ success = $ configurationManager -> set ( $ key , $ value , $ wrapperName , null , true ) ; } if ( $ success === false ) { throw new Exception ( sprintf ( "The value of '%s' can not be update with value '%s'." , $ key , $ value ) ) ; } $ configurationManager -> flush ( true ) ; if ( $ this -> accessor -> isReadable ( $ wrapper , $ key ) ) { $ newValue = $ this -> accessor -> getValue ( $ wrapper , $ key ) ; } else { $ newValue = $ configurationManager -> get ( $ key , $ wrapperName , null ) ; } if ( $ value != $ newValue ) { throw new Exception ( sprintf ( "Failed to update '%s' key '%s' with '%s' configuration." , $ wrapperName , $ key , $ value ) ) ; } }
Actualiza la configuracion del sistema
@example Given I set configuration 'WRAPPER_EPR_SALES' key "ENABLE_DIGITAL_INVOICING" with value "1"
@Given I set configuration :wrapperName key :key with value :value
Actualiza la configuracion del sistema