# |
Jul 20th 2018, 15:36 |
lorenzo |
and is the table you are going to look for also dynamic? you don’t know what the field is named? |
# |
Jul 20th 2018, 15:35 |
pedroseco |
I would prefet to ahve them as fields yes. |
# |
Jul 20th 2018, 15:35 |
pedroseco |
because its dynamic fields form a external api |
# |
Jul 20th 2018, 15:35 |
lorenzo |
no |
# |
Jul 20th 2018, 15:35 |
pedroseco |
does Mysql JSON_EXTRACT works in a text column? |
# |
Jul 20th 2018, 15:35 |
lorenzo |
but then again, why do that instead of just storing the field in the table itself? |
# |
Jul 20th 2018, 15:34 |
lorenzo |
you may want to change the datatype of that field to an actual json column |
# |
Jul 20th 2018, 15:34 |
lorenzo |
if you have stored it as a string (like in a varchar column, or text) then there is no way to find inside it |
# |
Jul 20th 2018, 15:29 |
pedroseco |
Im using Data Type Json so the results already come in array format and no tin json. |
# |
Jul 20th 2018, 15:29 |
pedroseco |
I have a json_encoded object in the database and would like to know what would be the best approuch to do a find() in the model where() a specific field on that json_object. |
# |
Jul 20th 2018, 15:28 |
pedroseco |
Hi Guys! |
# |
Jul 20th 2018, 13:35 |
neon1024 |
Assuming you meant ‘exists’ |
# |
Jul 20th 2018, 13:35 |
neon1024 |
Yes, https://github.com/davidyell/CakePHP3-Proffer/blob/master/src/Model/Behavior/ProfferBehavior.php#L59 |
# |
Jul 20th 2018, 12:31 |
birdy247 |
Is it possible to find if a given valitor exits |
# |
Jul 20th 2018, 12:08 |
neon1024 |
Well it’s not wrong `resource(174) of type (Unknown)` |
# |
Jul 20th 2018, 12:05 |
neon1024 |
Which might be unrelated |
# |
Jul 20th 2018, 12:05 |
neon1024 |
..and a lot of this `PHP Warning: fwrite(): supplied resource is not a valid stream resource in /Users/david/Sites/TelecomsCCA/vendor/cakephp/cakephp/src/Console/ConsoleOutput.php on line 253` |
# |
Jul 20th 2018, 12:04 |
neon1024 |
Just with a trace and sql errors |
# |
Jul 20th 2018, 12:04 |
neon1024 |
Currently it spaffs out a HUGE Wall-O-Text |
# |
Jul 20th 2018, 12:04 |
neon1024 |
I think there could be some improvements made to when Migrations fail to run |
# |
Jul 20th 2018, 11:30 |
lubos |
@admad thanks for another great plugin, works like a charm |
# |
Jul 20th 2018, 11:27 |
josbeir |
very nice ux |
# |
Jul 20th 2018, 11:27 |
josbeir |
@neon1024 that tool is actually very good imo |
# |
Jul 20th 2018, 11:20 |
admad |
@lubos yes using muffin/orderly |
# |
Jul 20th 2018, 11:20 |
neon1024 |
Great thanks, I will try and remember that one if I refactor :slightly_smiling_face: |
# |
Jul 20th 2018, 11:19 |
admad |
@neon1024 if you want 2.x style default ordering for a table there's my Orderly plugin :) |
# |
Jul 20th 2018, 11:16 |
josbeir |
bookmarked |
# |
Jul 20th 2018, 11:16 |
josbeir |
hey that looks nice |
# |
Jul 20th 2018, 11:12 |
neon1024 |
@josbeir RE: Database design tools. I was curious and had a search to see if an application was event needed. It seems not. https://app.sqldbm.com/MySQL/Draft/ |
# |
Jul 20th 2018, 10:51 |
neon1024 |
Or if you’re using an association, don’t forget you can define the sort in the association as well |
# |
Jul 20th 2018, 10:50 |
neon1024 |
Or as @dereuromark suggests. Add a field to your Table class and process it with a behaviour which hooks queries and appends the sorting |
# |
Jul 20th 2018, 10:49 |
neon1024 |
@lubos This is how I’ve tackled it. Not very clean, but it works. I’m sure you can adapt the technique to suit your use-case |
# |
Jul 20th 2018, 10:48 |
neon1024 |
File uploaded https://cakesf.slack.com/files/U1BT622HW/FBU6U8G5T/default_ordering_using_crud.sh / https://slack-files.com/T053DPNCM-FBU6U8G5T-8efb7797da |
# |
Jul 20th 2018, 10:48 |
hmic |
sorry, beforeFind |
# |
Jul 20th 2018, 10:46 |
lubos |
hmic, you said in a beforeFilter call back, that's the controller callback or am I wrong? :slightly_smiling_face: |
# |
Jul 20th 2018, 10:45 |
asdfgh |
:D |
# |
Jul 20th 2018, 10:45 |
asdfgh |
neon1024 too long |
# |
Jul 20th 2018, 10:44 |
neon1024 |
Just curious asdfgh, why not jkl as well? |
# |
Jul 20th 2018, 10:43 |
hmic |
asdfgh: return response withBody from the action |
# |
Jul 20th 2018, 10:42 |
hmic |
lubos: i have not been talking about the controller. both go into zour table |
# |
Jul 20th 2018, 10:42 |
asdfgh |
guys how can i reply with a string instead creating aview? |