public function update($id, $data)
 {
     if (!$this->tableGateway->update((array) $data, ['id' => $id])) {
         return new ApiProblem(500, 'Erro ao atualizar registro.');
     }
     return true;
 }
 public function update($id, $data)
 {
     $hydrator = new ObjectProperty();
     $data = $hydrator->extract($data);
     $this->tableGateway->update($data, array('id' => $id));
     return $data;
 }
Ejemplo n.º 3
0
 public function update($id, $data)
 {
     $this->find($id);
     $hydrator = new ObjectProperty();
     $this->tableGateway->update($hydrator->extract($data), ['id' => (int) $id]);
     return $this->find($id);
 }
Ejemplo n.º 4
0
 /**
  * Update a resource
  */
 public function update($id, $userEntity)
 {
     if (!$id) {
         return new ApiProblem(415, "Unsupported Media Type");
     }
     $this->tableGateway->update((array) $userEntity, ["id" => $id]);
     return $this->find($id);
 }
Ejemplo n.º 5
0
 public function save(Motivo $motivo)
 {
     $data = $motivo->toArray();
     if (empty($motivo->codigo)) {
         $this->tableGateway->insert($data);
     } else {
         $this->tableGateway->update('codigo=' . $motivo->codigo);
     }
 }
 public function update($id, $data)
 {
     $this->tableGateway->update((array) $data, ["id" => (int) $id]);
     return $this->find($id);
 }
Ejemplo n.º 7
0
 public function patch($id, $data)
 {
     $mapper = new UsersMapper();
     return $this->tableGateway->update($mapper->extract($data), ['id' => (int) $id]);
 }
 public function update($id, $data)
 {
     $data = array('username' => $data->username, 'password' => $data->password, 'first_name' => $data->first_name, 'last_name' => $data->last_name, 'role' => $data->role);
     $this->tableGateway->update($data, array('id' => $id));
     return $data;
 }
Ejemplo n.º 9
0
 public function updateItem($id, array $data)
 {
     $this->itemTable->update($data, ['id' => (int) $id]);
     return $this->itemTable->select(['id' => (int) $id])->current();
 }
Ejemplo n.º 10
0
 public function patch($id, $data)
 {
     $updateData = ['name' => $data->name, 'description' => $data->description, 'price' => $data->price];
     return $this->tableGateway->update($updateData, ['id' => (int) $id]);
 }
Ejemplo n.º 11
0
 /**
  * Replace an existing resource.
  *
  * @param int|string $id Identifier of resource.
  * @param array|object $data Data with which to replace the resource.
  * @return array|object Updated resource.
  */
 public function update($id, $data)
 {
     $data = $this->retrieveData($data);
     $this->table->update($data, [$this->identifierName => $id]);
     return $this->fetch($id);
 }
Ejemplo n.º 12
0
 public function update($id, $data)
 {
     $mapper = new ProductsMapper();
     return $this->tableGateway->update($mapper->extract($data), ['id' => $id]);
 }
Ejemplo n.º 13
0
 public function patch($id, $data)
 {
     $updateData = $this->setTratarData($data);
     return $this->tableGateway->update($updateData, ['id' => (int) $id]);
 }
 public function update($user, $id)
 {
     $this->tableGateway->update((array) $user, ['id' => (int) $id]);
     return $this->findById($id);
 }