summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDurham Hale <[email protected]>2012-08-28 22:52:00 +0100
committerDurham Hale <[email protected]>2012-08-28 22:52:00 +0100
commitdd13760408d6259b37090e8bb066c35f15661b7f (patch)
tree2dadc1a4e7114eb2faccece979fab54ced97c821
parentb86d2ef4196ce0ab22aad4c836be077ba9051977 (diff)
Minor tweaks to formatting on class and documentation
-rw-r--r--README.markdown15
-rw-r--r--idiorm.php4
2 files changed, 14 insertions, 5 deletions
diff --git a/README.markdown b/README.markdown
index d148145..9b41dc6 100644
--- a/README.markdown
+++ b/README.markdown
@@ -45,7 +45,8 @@ Changelog
* Add `order_by_expr` method [sandermarechal]
* Add support for raw queries without parameters argument [sandermarechal]
-* Add support to set multiple properties at once by passing an associative to `set` method [sandermarechal]
+* Add support to set multiple properties at once by passing an associative array to `set` method [sandermarechal]
+* Allow an associative array to be passed to `configure` method [jordanlev]
Philosophy
----------
@@ -409,7 +410,11 @@ Other than setting the DSN string for the database connection (see above), the `
A shortcut is provided to allow passing multiple key/value pairs at once.
- ORM::configure(array('setting_name_1' => 'value_for_setting_1', 'setting_name_2' => 'value_for_setting_2', 'etc' => 'etc'));
+ ORM::configure(array(
+ 'setting_name_1' => 'value_for_setting_1',
+ 'setting_name_2' => 'value_for_setting_2',
+ 'etc' => 'etc'
+ ));
#### Database authentication details ####
@@ -423,7 +428,11 @@ Some database adapters (such as MySQL) require a username and password to be sup
Or you can combine the connection setup into a single line using the configuration array shortcut:
- ORM::configure(array('connection_string' => 'mysql:host=localhost;dbname=my_database', 'username' => 'database_user', 'password' => 'top_secret'));
+ ORM::configure(array(
+ 'mysql:host=localhost;dbname=my_database',
+ 'username' => 'database_user',
+ 'password' => 'top_secret'
+ ));
#### PDO Driver Options ####
diff --git a/idiorm.php b/idiorm.php
index 9bd61c8..8291181 100644
--- a/idiorm.php
+++ b/idiorm.php
@@ -159,8 +159,8 @@
if (is_array($key)) {
// Shortcut: If only one array argument is passed,
// assume it's an array of configuration settings
- foreach ($key as $one_key => $one_value) {
- self::configure($one_key, $one_value);
+ foreach ($key as $conf_key => $conf_value) {
+ self::configure($conf_key, $conf_value);
}
} else {
if (is_null($value)) {