コード例 #1
0
 public function update(array $data)
 {
     if (isset($data['userId'])) {
         unset($data['userId']);
     }
     return parent::update($data);
 }
コード例 #2
0
 public function update(array $data)
 {
     if (($user = $this->getEm()->getRepository($this->entity)->findOneByEmail($data['email'])) && $user->getId() != $data['id']) {
         $this->response['messages'] = ['Email ja consta em nosso banco de dados'];
         $this->response['status'] = false;
         return $this->response;
     }
     $this->response = parent::update($data);
     if ($this->response['status']) {
         $this->response['data'] = $this->response['data']->toArrayApi();
     }
     return $this->response;
 }