# |
Jan 14th 2020, 15:40 |
ricksaccous |
please read through the suggested set up |
# |
Jan 14th 2020, 15:39 |
shifat.it |
why ?? |
# |
Jan 14th 2020, 15:39 |
shifat.it |
it works perfectly |
# |
Jan 14th 2020, 15:39 |
shifat.it |
but if i do "cake server" |
# |
Jan 14th 2020, 15:39 |
shifat.it |
it doesn't load css |
# |
Jan 14th 2020, 15:38 |
shifat.it |
In my local machine if i start apache, mysql and then try url "localhost/project_name" |
# |
Jan 14th 2020, 15:38 |
shifat.it |
Tibor. |
# |
Jan 14th 2020, 15:37 |
shifat.it |
ok |
# |
Jan 14th 2020, 15:35 |
tibor.hajos |
@shifat.it Do you mean that you want to deploy your site on a server? ```bin/cake server``` is meant for development purposes only. If you'd like to deploy your project to yoursitehere.com there's an awesome guide here: https://book.cakephp.org/3/en/deployment.html |
# |
Jan 14th 2020, 15:33 |
shifat.it |
?? |
# |
Jan 14th 2020, 15:28 |
shifat.it |
Please help |
# |
Jan 14th 2020, 15:28 |
shifat.it |
May be it sounds so silly. but i dont have idea. |
# |
Jan 14th 2020, 15:28 |
shifat.it |
how can i run this on hosting site? |
# |
Jan 14th 2020, 15:27 |
shifat.it |
it runs at "localhost:8765" |
# |
Jan 14th 2020, 15:27 |
shifat.it |
I have a cake php project which i run using "/bin cake server" |
# |
Jan 14th 2020, 15:27 |
shifat.it |
I need your help |
# |
Jan 14th 2020, 15:26 |
shifat.it |
Hello |
# |
Jan 14th 2020, 14:52 |
this.impetus |
All kidding aside, sometimes one wants to learn the proper way to do a thing, and other times one wants permission to just get it done. :P |
# |
Jan 14th 2020, 14:51 |
neon1024 |
It’s only a thought ;) |
# |
Jan 14th 2020, 14:48 |
this.impetus |
@neon1024 Noted. I will attempt that, and then when I discover how little I understand what you're saying, will feel fine about mashing together some inelegant solution, confident that there wasn't a dead-easy option I'd missed. God I love this slack. |
# |
Jan 14th 2020, 14:47 |
neon1024 |
My first thought approach would be to use an array id’s for the records, and use some array_intersect callback or collections::filter method to create the two arrays you want, a keep and a delete and then action those in the ORM as required |
# |
Jan 14th 2020, 14:42 |
slackebot |
but intuitively... I'm assuming Cake thinks about this differently. |
# |
Jan 14th 2020, 14:42 |
this.impetus |
Hey guys, can anyone point me to where I might read about to remove established HABTM relationships when editing a record? Started here: https://book.cakephp.org/3/en/orm/saving-data.html#unlink-many-to-many-records But in context, the request object contains an array of the associations which should *remain* after the edit, rather than those being removed. I can easily enough manually do this in the controller with a little inference, |
# |
Jan 14th 2020, 14:34 |
ndm |
Thing is the clause isn't stored as an array, but as a query expression object, so there's really no other way :S |
# |
Jan 14th 2020, 14:26 |
neon1024 |
Iterating is clearer though :thumbsup: |
# |
Jan 14th 2020, 14:26 |
neon1024 |
..and `where()` with the second param `true` |
# |
Jan 14th 2020, 14:25 |
neon1024 |
I was thing `clause()` |
# |
Jan 14th 2020, 14:05 |
ndm |
except `iterateParts()` :) ... and `traverse()`, but that's just for reading |
# |
Jan 14th 2020, 14:04 |
ndm |
The array that holds the conditions is protected, and there's no public API for reading or overwriting. |
# |
Jan 14th 2020, 14:00 |
neon1024 |
You could get the array, change it and write it back |
# |
Jan 14th 2020, 13:26 |
val |
I wish there would be a simpler way. |
# |
Jan 14th 2020, 13:18 |
ndm |
One way would be to use `QueryExpression::iterateParts()`, and in the callback _not_ return the condition that you want to remove. |
# |
Jan 14th 2020, 13:10 |
val |
Hi, is there a way to remove one condition from QueryExpression object that has several conditions in 3.x? |
# |
Jan 14th 2020, 12:48 |
dereuromark |
if you are fine with the limitations, go for it :) No one is stopping u |
# |
Jan 14th 2020, 12:46 |
neon1024 |
True, hard to unload a trait |
# |
Jan 14th 2020, 12:39 |
dereuromark |
trait is hardcoded in, and less flexible based on event/flow. it directly replaces a parent, etc. usually a behavior is a bit cleaner if you want to have reusable functionality added into more than one table. |
# |
Jan 14th 2020, 12:20 |
neon1024 |
Although harder to get the Table alias from a trait I guess |
# |
Jan 14th 2020, 12:10 |
neon1024 |
Now I’ve copied that method into two Table classes it’s time to refactor into a .. trait maybe :thinking_face: |
# |
Jan 14th 2020, 12:09 |
neon1024 |
Although it’s a bit XY, as I’m actually trying to use the foc/search plugin to filter for ‘today’ using comparison on datetime, using date data. Meaning I have had to use a finder as my filter and wrap my datetime with `DATE()` method to get the comparison to work for a single day |
# |
Jan 14th 2020, 12:08 |
neon1024 |
I can only think that a trait requires ‘less framework’ than a trait |
# |
Jan 14th 2020, 12:08 |
neon1024 |
What factors dictate the choice between a Behaviour and a Trait for table class shared methods |