Harsh.daffodil Posted February 26, 2014 Share Posted February 26, 2014 what is work of configuration.php file or the configuration in modules php file Link to comment Share on other sites More sharing options...
vekia Posted February 26, 2014 Share Posted February 26, 2014 about what configuration.php file you're talking? i don't know any default "configuration.php" file Link to comment Share on other sites More sharing options...
Harsh.daffodil Posted February 26, 2014 Author Share Posted February 26, 2014 (edited) I want about ask the function of configuration::updateValue in module files Edited February 26, 2014 by Harsh.daffodil (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted February 26, 2014 Share Posted February 26, 2014 so, you're asking about Configuration class (classes/Configuration.php) this file contains function to deal with ps configuration. you asked about configuration::updateValue function. so, this function changes database entries in table: ps_configuration for example configuration::updateValue('somesetting','value'); will change 'somesetting' field to 'value' (in ps_configuration table) check this (it's a part of official docs) he Configuration objectAs you can see, our three blocks of code make use of a new object, Configuration. This is a PrestaShop-specific object, built to help developers put their module settings into PrestaShop database without having to resort on managing their own data tables. Specifically, it handles data from the ps_configurationdatabase table. So far, we're using three methods, to which we'll add another one: Configuration::get('myVariable'): retrieves a specific value from the database. Configuration::getMultiple(array('myFirstVariable', 'mySecondVariable', 'myThirdVariable')): retrieves several values from the database, and returns a PHP array. Configuration::updateValue('myVariable', $value): updates an existing database variable with a new value. If the variable does not yet exist, it creates it with that value. Configuration::deleteByName('myVariable'): deletes the database variable. There are many more, such as getInt() or hasContext(), but these four are the ones you will most use. As you can see, this in a very useful and easy to use object, and you will certainly use in many situations. Most modules use it too for their own settings. more info here: http://doc.prestashop.com/display/PS15/Creating+a+PrestaShop+module#CreatingaPrestaShopmodule-TheConfigurationobject Link to comment Share on other sites More sharing options...
Harsh.daffodil Posted February 26, 2014 Author Share Posted February 26, 2014 thanks it was quite useful for me Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now