Can't save record in CakePHP 3.1

Viewed 42

So I created a table to test and can't save simple data. I did cake bake model Test, so entity and table models should be fine. Also, connection to the database is fine since other models are been saved correctly. Controller.php:

public function test(){
  if ($this->request->is('post')){
    $this->loadModel('Test');
    $test = $this->Test->newEntity();
    $test = $this->Test->patchEntity($test,[
        'field_1'=>24,
        'field_2'=>12
    ]);
    $this->Test->save($test);
}     
            

I checked with debug and $this->Test and the $test object are created fine. Still I get this error: Error

Database table: Database table

0 Answers
Related