Log message #4202945

# At Username Text
# Sep 12th 2019, 16:43 jh (and you could group concat within SQL to fetch nested data in one query say json encoded... and then unfold the returned data struct of addresses in your application... more complex, little gain)
# Sep 12th 2019, 16:42 jh (in theory in sql you can do all in one query but then you get duplications for the primary query... aka 10 user rows with the same user data for 10 different addresses of the same user)
# Sep 12th 2019, 16:41 this.impetus right. k. thanks
# Sep 12th 2019, 16:41 jh user hasMany addresses - you need to fetch all the addresses based on the foreign key so you need a separate query
# Sep 12th 2019, 16:40 jh user hasOne profile - you can get the profile fields in the same row as the user data
# Sep 12th 2019, 16:40 jh for hasOne or belongsTo you can return the associated data in the same table as it is only one line per association
# Sep 12th 2019, 16:40 jh because every query only returns one "table"
# Sep 12th 2019, 16:40 jh if it is hasMany it has to run another query
# Sep 12th 2019, 16:39 jh if it is hasOne or belongsTo it can be done via a JOIN aka same query
# Sep 12th 2019, 16:39 this.impetus HasMany, here
# Sep 12th 2019, 16:39 jh @this.impetus it depends on the type of association
# Sep 12th 2019, 16:39 jh if that was the case you could do that by widget on your website
# Sep 12th 2019, 16:39 this.impetus Quick syntactic question; is this three queries ``` contain('Services', 'Services.Institutions' => ['fields'=> ['title']], 'Services.Serviceroles' => ['fields'=> ['title']])``` or is that just elaborating on exactly how I want `Services` and it's associations contained?
# Sep 12th 2019, 16:38 jh now sadly there are no declarative shadow doms
# Sep 12th 2019, 16:38 jh creating reset and default stylesheets that never annoy you
# Sep 12th 2019, 16:38 jh you can basicall define defaults that have 0 specificity
# Sep 12th 2019, 16:38 jh https://github.com/w3c/csswg-drafts/issues/2143
# Sep 12th 2019, 16:38 jh here is something that will mean you can drop a lot of the preprocessing
# Sep 12th 2019, 16:37 this.impetus we are all sinners on this Earth
# Sep 12th 2019, 16:36 jh SCSS i hope :P
# Sep 12th 2019, 16:36 jh SASS :(
# Sep 12th 2019, 16:36 this.impetus haha inoas you are vastly overestimating my knowledge brother. talk to me about SASS frameworks and I can dance.
# Sep 12th 2019, 16:36 jh there is also lazy association loading plugin which would fire queries once you access associations of entities on the fly
# Sep 12th 2019, 16:35 jh for reference Rails's arel works the same pretty much afair
# Sep 12th 2019, 16:35 this.impetus thanks! I mean I don't know if I'm going to make use of that today, but that's a paradigm-shifting insight (to me).
# Sep 12th 2019, 16:35 this.impetus oh!
# Sep 12th 2019, 16:35 this.impetus oooooh
# Sep 12th 2019, 16:35 jh until you do that you can continue to build the query object, adding more finders, adding more conditionals etc
# Sep 12th 2019, 16:34 jh foreach, or toArray()
# Sep 12th 2019, 16:34 jh @this.impetus so the query builder in cakephp builds some object that then is converted to vendor specific (mariadb, postgres, etc) sql code and executed once you want to access data out of it
# Sep 12th 2019, 16:20 this.impetus @jh It may help you to know that I am a front-end guy, haha; I loosely understand what you've said, but not really the implications beyond the simple idea that there are fast and slow, or efficient and inefficient ways to retrieve data. :S
# Sep 12th 2019, 16:17 jh not sure about the contains though... probably only for the primary query
# Sep 12th 2019, 16:16 jh ->sql() will get you the sql (with placeholders)
# Sep 12th 2019, 16:16 jh afair the query builder is lazy aka if you do not fetch something from it it is just a query object
# Sep 12th 2019, 16:16 jh toArray() will also run formatResults and not sure if only then or earlier all the accessors in the entities
# Sep 12th 2019, 16:13 this.impetus On any other day I'd be super curious about that, haha, today is just get-to-the-finish-line. But thanks modi
# Sep 12th 2019, 16:12 ricksaccous pretty much transforms it into an array of entities, which is great because there is a lot you can do with entity magic
# Sep 12th 2019, 16:11 this.impetus oh thank god. :the_horns:
# Sep 12th 2019, 16:11 ricksaccous it won't be exactly like cakephp2 but yep
# Sep 12th 2019, 16:10 ricksaccous ->toArray
# Sep 12th 2019, 16:10 this.impetus Last question today guys, I swear; is there any means at all of getting a query object to just dump an array of data as cake once did? One of those days where I jsut want to get the work done and do the learning on my own time...