From 619f43b3bfab9eb034dca3e54c7466055240c861 Mon Sep 17 00:00:00 2001 From: vlw Date: Wed, 25 Sep 2024 13:28:15 +0000 Subject: [PATCH] fix(doc): remove reference to removed method `flatten()` from README (#38) Closes #14 Reviewed-on: https://codeberg.org/vlw/php-mysql/pulls/38 Co-authored-by: vlw Co-committed-by: vlw --- README.md | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/README.md b/README.md index 7d94867..f4b76c5 100644 --- a/README.md +++ b/README.md @@ -107,24 +107,6 @@ $beverages = MySQL->for("beverages")->select(["beverage_name", "beverage_size"]) ] ``` -## Flatten array to single dimension - -If you don't want an array of arrays and would instead like to access each key value pair directly. Chain the `MySQL->flatten()` anywhere before `MySQL->select()`. -This will return the key value pairs of the first entry directly. - -> **Note** -> This method will not set `LIMIT 1` for you. It is recommended to chain `MySQL->limit(1)` anywhere before `MySQL->select()`. [You can read more about it here](https://github.com/VictorWesterlund/php-libmysqldriver/issues/14) - -```php -$coffee = MySQL->for("beverages")->limit(1)->flatten()->select(["beverage_name", "beverage_size"]); // SELECT beverage_name, beverage_size FROM beverages WHERE beverage_type = "coffee" LIMIT 1 -``` -```php -[ - "beverage_name" => "cappuccino", - "beverage_size" => 10 -] -``` - # INSERT Chain `MySQL->insert()` anywhere after a [`MySQL->for()`](#for) to append a new row to a database table. @@ -329,9 +311,6 @@ MySQL->limit( ): self; ``` -> **Note** -> You can also flatten to a single dimensional array from the first entity by chaining [`MySQL->flatten()`](#flatten-array-to-single-dimension) - ## Passing a single integer argument This will simply `LIMIT` the results returned to the integer passed