php - Cakephp 3 newEntity() not working -


i have maintenance cakephp 3 project , in project, have create newentity using array variable , data not save database. set print_r result of usermodel doesn't show anything.

i using nginx server (not apache), mysql 5.6, cakephp 3.

here code used.

 $usermodel = $this->newentity($tabledata);         print_r($usermodel);         if (!$usermodel->errors()) {              $result = $this->save($usermodel);             if ($result)             {                 return $result->id;             }         } else {             return false;         } 

there 2 things need check first.

  1. try outputting $tabledata variable , ensuring elements in match against data structure have model object you're trying create.
  2. to manipulate entity. should calling using $this->modelname->newentity($tabledata); $this->modelname->save($usermodel)

Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -