1
にエラーがなくてもエンティティを保存できませんコード:
$user = $this->Users->newEntity();
$tmp_hash = md5(rand(0, 1000));
$tmp_id = time();
/* Save individual data */
$user->id = $tmp_id;
$user->first_name = (!empty($user_profile->firstName)) ? $user_profile->firstName : "";
$user->last_name = (!empty($user_profile->lastName)) ? $user_profile->lastName : "";
$user->username = (!empty($user_profile->lastName) && !empty($user_profile->lastName)) ? $user_profile->firstName . "." . $user_profile->lastName : "";
$user->avatar = (!empty($user_profile->photoURL)) ? $user_profile->photoURL : "";
$user->role = "public";
$user->provider = $provider;
$user->provider_uid = $user_profile->identifier;
$user->gender = !empty($user_profile->gender) ? (($user_profile->gender == 'male') ? 'm' : 'f') : "";
$user->email = !empty($user_profile->email) ? $user_profile->email : "";
$user->password = $user_profile->identifier;
$user->link = $user_profile->profileURL;
$user->avatar = $user_profile->photoURL;
//$user->confirm_password = $user_profile->identifier;
$user->tmp_hash = $tmp_hash;
$user->isverified = (!empty($user_profile->emailVerified)) ? 1 : 0;
$user = $this->Users->patchEntity($user, $this->request->data);
debug($user);
$this->Users->save($user);
//debug($this->Users->invalidFields()); // he don't know invalidFields()
SQL文などを表示してデバッグして問題を見つけるにはどうすればよいですか? die( '2');
CakePHP-3のDebugKitを有効にして、そこにSQL文が表示されるようにしてください。 –