# |
May 2nd 2019, 05:32 |
slackebot |
``` |
# |
May 2nd 2019, 05:32 |
conehead |
@ra7bi Never tried, but there seems to be a `toList()` method as well. https://book.cakephp.org/3.0/en/orm/retrieving-data-and-resultsets.html#using-finders-to-load-data ``` / Calling all() will execute the query // and return the result set. $results = $query->all(); // Once we have a result set we can get all the rows $data = $results->toList(); // Converting the query to a key-value array will also execute it. $data = $query->toArray(); |
# |
May 2nd 2019, 04:35 |
dakota |
@ra7bi |
# |
May 2nd 2019, 04:35 |
dakota |
The collection class's combine method does just that (that's actually what find('list') uses internally) |
# |
May 2nd 2019, 04:11 |
ra7bi |
i've two table linked associated to each , and each table hasMany data from `x` table , i want to create a list of `x` table belong for both table |
# |
May 2nd 2019, 04:08 |
ra7bi |
i mean the result of find all i need to modify it and then convert it to list |
# |
May 2nd 2019, 04:07 |
ra7bi |
is there a function in cakephp 3.x to convert `find('all') ` results into `find('list')` |
# |
May 1st 2019, 20:25 |
ricksaccous |
interesting |
# |
May 1st 2019, 20:25 |
ricksaccous |
actually you can't bind field aliases |
# |
May 1st 2019, 19:34 |
ricksaccous |
and does bind mean I have to write raw SQL? |
# |
May 1st 2019, 19:34 |
ricksaccous |
do i absolutely have to bind() to be safe? |
# |
May 1st 2019, 19:34 |
ricksaccous |
if i need userdata in the column name |
# |
May 1st 2019, 18:33 |
maymeow |
@noel @neon1024 Thanks. I created one project some time ago and split functionality to plugins and it was mess i think. So for now i have 3 plugins for authentication, settings and utils |
# |
May 1st 2019, 15:46 |
neothermic |
I've gotten better at type-hinting for PHPStorm :) |
# |
May 1st 2019, 15:46 |
neon1024 |
@admad Hey, at least I’ll be safe when the Zombies come! |
# |
May 1st 2019, 15:46 |
neon1024 |
Lucky you’re in Cake 2 then! |
# |
May 1st 2019, 15:46 |
neothermic |
I do enjoy typehinting things that PHPStorm is unaware about, like the result of Guzzle's Promise\unwrap :) |
# |
May 1st 2019, 15:46 |
admad |
Fatal error: enough grey matter not found :P |
# |
May 1st 2019, 15:45 |
neon1024 |
Syntax error. |
# |
May 1st 2019, 15:45 |
neothermic |
`/** @var MaybeHumanInterface $neon1024 */` |
# |
May 1st 2019, 15:45 |
neon1024 |
How rude. I at least implement HumanBeingInterface and PSR8 |
# |
May 1st 2019, 15:44 |
neothermic |
`/** @var object $neon1024 */` |
# |
May 1st 2019, 15:40 |
neon1024 |
Ahh, just needed a typehint! |
# |
May 1st 2019, 15:39 |
neon1024 |
Lazy perhaps, but `$query->count()` is a thing right? As `count($query->toArray())` seem silly, and I was certain that ResultSet implemented Collection, either trait or interface |
# |
May 1st 2019, 14:44 |
mrgrimpy |
thank you |
# |
May 1st 2019, 14:44 |
mrgrimpy |
ok |
# |
May 1st 2019, 14:39 |
admad |
There isn't |
# |
May 1st 2019, 14:29 |
mrgrimpy |
Is there a way to prevent the whitespaces and \n in the generated key? |
# |
May 1st 2019, 14:27 |
mrgrimpy |
Good morning, I have a question concerning the bin/cake bake i18n command and the way I format the translation IDs. If I do: <p> </p> |
# |
May 1st 2019, 13:45 |
devito |
thanks |
# |
May 1st 2019, 13:45 |
neon1024 |
https://github.com/cakephp/docs/blob/3.0/en/orm/entities.rst |
# |
May 1st 2019, 13:44 |
neon1024 |
You can either browse the 3.next docs, or read the docs on github |
# |
May 1st 2019, 13:44 |
devito |
https://book.cakephp.org/3.0/en/orm/entities.html |
# |
May 1st 2019, 13:44 |
devito |
yeah sorry ment the cookbook |
# |
May 1st 2019, 13:43 |
slackebot |
https://www.facebook.com/CakePHP/posts/10158433586508135?__xts__[0]=68.ARBntP4IpOStJlFTvmOFQdD9cb6f3kFQd12uPPTOm4IQCoG-TQV2Y3orLzhRpnntz1EBptjAqF8IWNjkqmn51Wg_sz8qqIzCYqsFj7R7QANIkup5UdeT7QsNgEihGjJh-G-_uvCC7K-T-bqXyER0oKp-hq7dI64cZX9Q_HcZvFLD47LYK7lex-OfUIj5DmsqPx8q6ReYTh86qty-JaoneATlTdmo5T2LDDMMikpuPUUXEP46Ct9jTrgrMD31nxIpm-cdibUtbhOKT8GvOUccNesqC0DJBBS35RtjACocEAZTDM8qCll88cDywlnzM2xgGa3rRmeoQ-EaKwq7Tsxuand__tn__=-R |
# |
May 1st 2019, 13:43 |
neon1024 |
The book is down currently though, |
# |
May 1st 2019, 13:42 |
neon1024 |
Er, it’s up for me |
# |
May 1st 2019, 13:42 |
devito |
where did cakephp.org go? |
# |
May 1st 2019, 13:23 |
noel |
Plugins can also suit a micro-services architecture quite well because it (more-or-less) creates a black-box. |
# |
May 1st 2019, 13:21 |
neon1024 |
No harm in splitting up functionality into plugins though, but it will add some overhead for maintaining things as you’ll have to remember plugin prefixes and such everywhere |
# |
May 1st 2019, 13:20 |
neon1024 |
@maymeow Also worth remembering that without routing configuration plugins will add a plugin prefix to your routes |