# |
Jul 17th 2019, 10:51 |
neon1024 |
@aivaras.godliauskas I’m not. |
# |
Jul 17th 2019, 10:50 |
neon1024 |
:white_check_mark: |
# |
Jul 17th 2019, 10:50 |
aivaras.godliauskas |
@neon1024 can you tell how are you running benchmarks on cake? |
# |
Jul 17th 2019, 10:50 |
neon1024 |
It’s a non-standard table name, so you must declare `public $table = 'script_composed_of'` then it’ll work |
# |
Jul 17th 2019, 10:46 |
neon1024 |
Seems that because I have database constraints, I have to execute the fixtures in a specific order |
# |
Jul 17th 2019, 10:26 |
neon1024 |
Points if you can tell me why my Fixture isn’t actually creating a database table https://pastebin.com/UEnGV6vQ |
# |
Jul 17th 2019, 10:11 |
neon1024 |
Guess I could benchmark that myself actually :thinking_face: |
# |
Jul 17th 2019, 10:10 |
neon1024 |
Is it worthwhile to manually load fixtures for test-cases which need extra fixtures? So they’re not loaded for every test-case |
# |
Jul 17th 2019, 09:58 |
neon1024 |
Hey @dereuromark when doing a `@property` in the class, with or without a dollar? `@property \App\Model\Table\ExamplesTable $Examples` |
# |
Jul 17th 2019, 09:09 |
ankitgsolanki |
I have following line of code for update mysql mariaDB view. ```$stmt = $conn->execute('update `listing` set `longitude` = ?, `latitude` = ? where `id` = ?',[-96.1080, 31.7356, 1922]);``` And I am getting following error *General error: 1221 Incorrect usage of UPDATE and ORDER BY* |
# |
Jul 17th 2019, 08:45 |
maymeow |
@graziel i found reason why it isnt working. It looks like you can translate only default cakephp files if you want to translate own classes like me it will return error |
# |
Jul 17th 2019, 08:08 |
graziel |
@maymeow did quick check on cake 3.8.1 and works ok for me |
# |
Jul 17th 2019, 08:01 |
maymeow |
@graziel no i have config in app.php i didnt update anything :slightly_smiling_face:... problem is caused with i18n in my opinion |
# |
Jul 17th 2019, 07:59 |
admad |
sorry gtg |
# |
Jul 17th 2019, 07:57 |
h.mavisakalian |
@admad Can you give me an example of a raw SQL query that you’re talking about. |
# |
Jul 17th 2019, 07:54 |
maymeow |
@admad How? `$this->addPlugin('I18n');` i have installed package 3.79 |
# |
Jul 17th 2019, 07:52 |
admad |
if you can't then use the search plugin and figure out the solution by trail and error :slightly_smiling_face: |
# |
Jul 17th 2019, 07:51 |
admad |
that's still pseudo SQL, not actual SQL :slightly_smiling_face: |
# |
Jul 17th 2019, 07:50 |
h.mavisakalian |
$array will have values like this … %Value1%, %Value2%, %Value3% |
# |
Jul 17th 2019, 07:49 |
h.mavisakalian |
“SELECT name FROM Users WHERE name LIKE {$array}” |
# |
Jul 17th 2019, 07:47 |
admad |
@h.mavisakalian step 1: Figure out the SQL query you need to get the result you want |
# |
Jul 17th 2019, 07:47 |
conehead |
I think `IN` is at least one. So Even with 2 or more values it should show up |
# |
Jul 17th 2019, 07:46 |
h.mavisakalian |
also bring the results that have 2 of the array values in the title |
# |
Jul 17th 2019, 07:46 |
h.mavisakalian |
but |
# |
Jul 17th 2019, 07:46 |
h.mavisakalian |
$query = $this->Users->find(‘all’,[ ‘conditions’ => [‘name LIKE’ => $searchArray], ‘order’ => [‘Users.id’ => ‘ASC’] ]); |
# |
Jul 17th 2019, 07:46 |
h.mavisakalian |
something like this |
# |
Jul 17th 2019, 07:45 |
h.mavisakalian |
that is why I mentioned the LIKE |
# |
Jul 17th 2019, 07:45 |
h.mavisakalian |
@conehead Thank you, but I need something else… you see the problem is I need the query to give me the results of the rows that for example have 2 values from the array as well |
# |
Jul 17th 2019, 07:42 |
admad |
yes |
# |
Jul 17th 2019, 07:41 |
koeller |
@admad So the proper way would be that the client sends another index request? |
# |
Jul 17th 2019, 07:41 |
conehead |
@h.mavisakalian probably you need something like this: ``` $query = $this->Users->find(‘all’,[ ‘conditions’ => ['yourField IN' => $searchArray], ‘order’ => [‘Users.id’ => ‘ASC’] ]); ``` |
# |
Jul 17th 2019, 07:40 |
admad |
@koeller for a REST API for a delete request you just respond with a success/failure status |
# |
Jul 17th 2019, 07:39 |
admad |
@maymeow if it's a standalone plugin first plug it into an app :slightly_smiling_face: |
# |
Jul 17th 2019, 07:39 |
koeller |
@admad: Okay, what would be the best way then? setting a view variable with the result of the finder im using in index Action? |
# |
Jul 17th 2019, 07:39 |
graziel |
@maymeow you are probably missing cache config after updating cake https://github.com/cakephp/app/blob/master/config/app.default.php#L111 |
# |
Jul 17th 2019, 07:38 |
admad |
@koeller since you mention using JWT auth I assume you are working on a stateless REST API. There's no redirection for such requests. |
# |
Jul 17th 2019, 07:37 |
maymeow |
Any idea how to solve this? |
# |
Jul 17th 2019, 07:36 |
admad |
how do you expect `‘conditions’ => $searchArray` to work without specifying which fields/columns to use? |
# |
Jul 17th 2019, 07:35 |
dereuromark |
see awesome list |
# |
Jul 17th 2019, 07:35 |
h.mavisakalian |
which plugin is that? |
# |
Jul 17th 2019, 07:35 |
slackebot |
$this->Crud->on('afterDelete') with $this->redirect(['index']) and $this->setAction('index'), but I would only recieve a NotFoundException. I'm a bit puzzled here. Thank you for reading! |