Trying to run that code:
$user = parent::me();
$user->nome = $this->request->getPost('nome');
$user->celular = $this->request->getPost('celular');
$user->birthday = \DateTime::createFromFormat('d/m/Y', $this->request->getPost('birthday'))->format('Y-m-d H:i:s');
$user->cep = $this->request->getPost('cep');
$user->rua = $this->request->getPost('rua');
$user->numero = $this->request->getPost('numero');
$user->complemento = $this->request->getPost('complemento');
$user->bairro = $this->request->getPost('bairro');
$user->cidade = $this->request->getPost('cidade');
$user->estado = $this->request->getPost('estado');
$user->updatedAt = date('y-m-d H:i:s');
if ($user->usertype == 2) {
$user->bank = $this->request->getPost('bank');
$user->ag = $this->request->getPost('ag');
$user->cc = $this->request->getPost('cc');
$user->profissao = $this->request->getPost('profissao');
}
try {
$user->save(); // line 301
Returning: Catchable fatal error: Object of class stdClass could not be converted to string in line 301
Someone can help me?
Ps parent::me() -> User::findFirstByUser_id($this->session->get('user')['user_id']); Ps2 $user seems to be ok, the error occurs only on save