cakephp - saving some fields as null but they do have data -
i´m trying insert new record, it´s not saving fields: numandares, numaptos , numtipo. save them null.
'condominio_id' , 'nome' saving correctly.
my newentity before , after save:
\src\controller\condominioscontroller.php (line 142) object(app\model\entity\torre) { 'condominio_id' => (int) 59, 'numandares' => (int) 0, 'numaptos' => (int) 11, 'numtipo' => (int) 0, 'nome' => (int) 1, '[new]' => true, '[accessible]' => [ '*' => true ], '[dirty]' => [ 'condominio_id' => true, 'numandares' => true, 'numaptos' => true, 'numtipo' => true, 'nome' => true ], '[original]' => [], '[virtual]' => [], '[errors]' => [], '[invalid]' => [], '[repository]' => 'torres' } \src\controller\condominioscontroller.php (line 146) object(app\model\entity\torre) { 'condominio_id' => (int) 59, 'numandares' => (int) 0, 'numaptos' => (int) 11, 'numtipo' => (int) 0, 'nome' => (int) 1, 'id' => (int) 44, '[new]' => false, '[accessible]' => [ '*' => true ], '[dirty]' => [], '[original]' => [], '[virtual]' => [], '[errors]' => [], '[invalid]' => [], '[repository]' => 'torres' } when save:
$torre = $torretable->newentity(); $torre->condominio_id = $condominio->id; $torre->numandares = 0; $torre->numaptos = 11; $torre->numtipo = 0; $torre->nome = $x+1; debug($torre); if ($torretable->save($torre)) { debug($torre); any helpl?
Comments
Post a Comment