# |
Jul 4th 2018, 02:54 |
pmoraes |
``` $this->belongsToMany('AffiliatedCompanies', [ 'className' => 'Companies', 'foreignKey' => 'company_id', 'targetForeignKey' => 'affiliated_company_id', 'joinTable' => 'affiliated_companies' ]);```` |
# |
Jul 4th 2018, 02:53 |
pmoraes |
Error: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'company_id' in 'where clause' |
# |
Jul 4th 2018, 02:53 |
pmoraes |
let me check |
# |
Jul 4th 2018, 02:53 |
pmoraes |
hmm |
# |
Jul 4th 2018, 02:53 |
hmic |
only the association name |
# |
Jul 4th 2018, 02:52 |
hmic |
no, classname does not change there |
# |
Jul 4th 2018, 02:52 |
pmoraes |
this its not saving anything |
# |
Jul 4th 2018, 02:52 |
pmoraes |
```$this->belongsToMany('AffiliatedCompanies', [ 'className' => 'AffiliatedCompanies', 'foreignKey' => 'company_id', 'targetForeignKey' => 'affiliated_company_id', 'joinTable' => 'affiliated_companies' ]);``` |
# |
Jul 4th 2018, 02:50 |
pmoraes |
I already did that many times |
# |
Jul 4th 2018, 02:50 |
hmic |
pmoraes: it would rather need to read ...belongsToMany('AffiliatedCompanies', [ ... |
# |
Jul 4th 2018, 02:49 |
pmoraes |
anyone has some idea about what is happening? |
# |
Jul 4th 2018, 02:49 |
pmoraes |
$this->Form->control('companies._ids' |
# |
Jul 4th 2018, 02:49 |
pmoraes |
in my form I have |
# |
Jul 4th 2018, 02:48 |
pmoraes |
File uploaded https://cakesf.slack.com/files/U6X99ATG8/FBKMD6VV5/captura_de_tela_2018-07-03_a__s_23.48.10.png / https://slack-files.com/T053DPNCM-FBKMD6VV5-8264b4b991 |
# |
Jul 4th 2018, 02:48 |
pmoraes |
its saving so |
# |
Jul 4th 2018, 02:48 |
pmoraes |
if I invert the foreignKey and targetForeignKey |
# |
Jul 4th 2018, 02:48 |
pmoraes |
File uploaded https://cakesf.slack.com/files/U6X99ATG8/FBJ3FDR97/captura_de_tela_2018-07-03_a__s_23.47.28.png / https://slack-files.com/T053DPNCM-FBJ3FDR97-166d34e044 |
# |
Jul 4th 2018, 02:47 |
pmoraes |
in this case it saving the affiliated_company_id in company_in and in affiliated_company_id its saving 0 |
# |
Jul 4th 2018, 02:46 |
pmoraes |
company_id and affiliated_company_id |
# |
Jul 4th 2018, 02:46 |
pmoraes |
in my affiliated_companies I have |
# |
Jul 4th 2018, 02:45 |
pmoraes |
`$this->belongsToMany('Companies', [ 'className' => 'Companies', 'foreignKey' => 'company_id', 'targetForeignKey' => 'affiliated_company_id', 'joinTable' => 'affiliated_companies' ]);` |
# |
Jul 4th 2018, 02:45 |
pmoraes |
I'm doing this |
# |
Jul 4th 2018, 02:44 |
pmoraes |
I will have affiliated companies |
# |
Jul 4th 2018, 02:44 |
pmoraes |
or better |
# |
Jul 4th 2018, 02:44 |
pmoraes |
like Companies belongsToMany Companies |
# |
Jul 4th 2018, 02:44 |
pmoraes |
I need to make a relation between the same table |
# |
Jul 4th 2018, 02:44 |
pmoraes |
I'm having a doubt about the HABTM |
# |
Jul 4th 2018, 02:44 |
pmoraes |
Hey guys |
# |
Jul 3rd 2018, 16:32 |
dakota |
You would get the response body using the response object like `(string)$this->_response->getBody()` |
# |
Jul 3rd 2018, 16:32 |
dakota |
https://book.cakephp.org/3.0/en/development/testing.html#testing-a-json-responding-controller |
# |
Jul 3rd 2018, 16:32 |
dakota |
Only saw this now. You don’t check the result of `get` (Since it doesn’t actually return anything) |
# |
Jul 3rd 2018, 16:12 |
admad |
Might also have to update validOptions in view class |
# |
Jul 3rd 2018, 16:11 |
admad |
I believe there's viewbuilder::set options() |
# |
Jul 3rd 2018, 15:50 |
zmurphy |
What's the preferred method of passing something to the AppView class, but not necessarily the view file? I need to pass the current user's id to a helper loaded in AppView's initialize. |
# |
Jul 3rd 2018, 14:33 |
neon1024 |
Or use @dereuromark upgrade shell |
# |
Jul 3rd 2018, 14:20 |
ollibohland |
thanks everybody |
# |
Jul 3rd 2018, 14:19 |
ollibohland |
will double-check all the files and replace them one-by-one. |
# |
Jul 3rd 2018, 14:19 |
ollibohland |
year, update was made by other dev...talked to him and he reported that he did....hmnmmm. thanks guys, think the hint with the skeleton app point to the correct direction |
# |
Jul 3rd 2018, 14:16 |
flavius |
when i upgrade i usually check for differences in the app skeleton as well |
# |
Jul 3rd 2018, 14:16 |
josbeir |
start with replacing the bin folder |
# |
Jul 3rd 2018, 14:15 |
flavius |
yus! |