# |
Jul 17th 2017, 13:06 |
adriencs |
yeah was looking at cakebook API, but it come after the query, load a sh!ton of data |
# |
Jul 17th 2017, 13:05 |
hmic |
https://book.cakephp.org/3.0/en/core-libraries/collections.html |
# |
Jul 17th 2017, 13:05 |
hmic |
you might want to checkout the Collection class docs - every query result is a collection actually, so you can use all of that goodness... |
# |
Jul 17th 2017, 13:04 |
adriencs |
`->countBy` ? Never heard about that :thinking_face: |
# |
Jul 17th 2017, 13:02 |
hmic |
adriencs maybe like: $q->find()->contain('OtherTable')->countBy(function($el) { retrun count($el->other_table); }); |
# |
Jul 17th 2017, 12:55 |
adriencs |
howTo: count results from a contain who's hasMany link ? |
# |
Jul 17th 2017, 12:53 |
anvyst |
it should as per code: https://api.cakephp.org/1.3/source-class-View.html#380 |
# |
Jul 17th 2017, 12:36 |
BrainWork |
hi, in cakephp 1.3 (yes, i know, old version) is it possible to have a / in a call to $this->element() in a view? e.g. <?=$this->element('somedir/elementname')?> ? i ask because we have an awful lot of elements, it's a huge codebase. |
# |
Jul 17th 2017, 12:13 |
juststeveking |
Would it be a virtual field, just with the result being an array of items? |
# |
Jul 17th 2017, 12:03 |
juststeveking |
I have a Person model, and on that I have a method called collection. What collection does is get the result of a query to "collect" loads of data. I want the Model to load this by default |
# |
Jul 17th 2017, 12:02 |
juststeveking |
Anybody able to advise how I can eager load the result of a function with a model? |
# |
Jul 17th 2017, 11:44 |
johnwayne |
I have one data set and want to filter data based on given parameter. I am getting right data if I am using orWhere, but if I want to filter data from another table with multiple results then matching filter all data.. |
# |
Jul 17th 2017, 11:41 |
neon1024 |
Matching is used to filter out data, not include more. Sounds like you want contain |
# |
Jul 17th 2017, 11:39 |
johnwayne |
https://pastebin.com/wcV2vyq5 |
# |
Jul 17th 2017, 11:39 |
johnwayne |
How can I use matching on one table but using matching I want to include results from my where or orWhere on another table? |
# |
Jul 17th 2017, 11:29 |
inoas |
$this->setConfig(collection($this->getConfig())->someCalls()->toArray())? |
# |
Jul 17th 2017, 11:29 |
inoas |
if it is a config object you could do so but I find it to be horrible design... just set it back and be done with it? |
# |
Jul 17th 2017, 11:23 |
neon1024 |
Or could I pass it by reference back into the config instance? |
# |
Jul 17th 2017, 11:23 |
neon1024 |
I assume I can assign $this->getConfig() to a variable, re-order it and reset it to $this->setConfig() |
# |
Jul 17th 2017, 11:22 |
neon1024 |
I want to process some config in my helper, but I want it to be descending order based on a priority field |
# |
Jul 17th 2017, 11:16 |
neon1024 |
https://www.quora.com/GitHub-What-is-the-significance-of-the-Ship-It-squirrel |
# |
Jul 17th 2017, 10:49 |
spencdev |
i genuinely don't understand how ship...it relates to squirrels though |
# |
Jul 17th 2017, 10:48 |
spencdev |
Dropbox one worked for me. #soldierSquirrel |
# |
Jul 17th 2017, 10:46 |
hmic |
i think that link is similarily broken as the dropbox and imageshack links are :p |
# |
Jul 17th 2017, 10:45 |
braeden |
I'm scared |
# |
Jul 17th 2017, 10:44 |
inoas |
our bot = https://www.youtube.com/watch?v=iqIq4B1rgl4 |
# |
Jul 17th 2017, 10:44 |
braeden |
:| |
# |
Jul 17th 2017, 10:44 |
slackebot |
!strcmp |
# |
Jul 17th 2017, 10:44 |
slackebot |
Command sent from Slack by braeden: |
# |
Jul 17th 2017, 10:44 |
inoas |
our bot is last gen - but I like last gen! |
# |
Jul 17th 2017, 10:44 |
braeden |
ship ... it |
# |
Jul 17th 2017, 10:42 |
inoas |
that's the one |
# |
Jul 17th 2017, 10:42 |
inoas |
ship it ;)? |
# |
Jul 17th 2017, 10:42 |
inoas |
not the trigger word... |
# |
Jul 17th 2017, 10:42 |
inoas |
ship ;)? |
# |
Jul 17th 2017, 10:42 |
inoas |
Is there "common sense" semantic difference between "stack" and "queue" in CS? |
# |
Jul 17th 2017, 10:41 |
braeden |
:) |
# |
Jul 17th 2017, 10:41 |
spencdev |
Definitely /kb braeden. lol |
# |
Jul 17th 2017, 10:40 |
hmic |
its a simple decision to take |
# |
Jul 17th 2017, 10:40 |
hmic |
just by using __d() or __() in your plugin |
# |
Jul 17th 2017, 10:40 |
hmic |
or you can ship it without and let the app prvide the translations |