I'm trying to save a data from a multiple select. This data is relacioned where "Request" hasMany "Requestc". The foriegnKey is "request_id"
My Controller:
if ($this->request->is('post')) {
$solicitacao = $this->Request->save($this->request->data['Request']);
//Verifica se a request foi salva e se sim, salva quais as certidões foram pedidas na tabela requests_certidoes
if(!empty($solicitacao)) {
$this->request->data['Requestc']['request_id'] = $this->Request->id;
// debug($this->request->data);
$this->Request->Requestc->saveAll($this->request->data);
}
}
This is my data from $this->request->data
:
array(
'Request' => array(
'motivo' => 'Licitação',
'nome_licitacao' => '',
'data_pregao' => '',
'nome_cliente' => '',
'outros' => ''
),
'Requestc' => array(
'caminho' => array(
(int) 0 => '1',
(int) 1 => '3'
),
'request_id' => '60'
)
)
And that's the error:
Error: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'Array' in 'field list'
SQL Query: INSERT INTO societario
.requests_certidoes
(caminho
, request_id
) VALUES (Array, 62)
Thanks for all