Ventas
This commit is contained in:
@ -102,7 +102,7 @@ abstract class Repository implements Define\Repository
|
||||
$this->connection->execute($query, $values);
|
||||
return $this->connection->getPDO()->lastInsertId();
|
||||
}
|
||||
protected function update(Model $model, array $columns, array $data): Define\Model
|
||||
protected function update(Define\Model $model, array $columns, array $data): Define\Model
|
||||
{
|
||||
$changes = [];
|
||||
$values = [];
|
||||
@ -119,10 +119,7 @@ abstract class Repository implements Define\Repository
|
||||
$query = "UPDATE `{$this->getTable()}` SET {$columns_string} WHERE `{$this->getKey()}` = ?";
|
||||
$values []= $model->id;
|
||||
$this->connection->execute($query, $values);
|
||||
$id = $model->id;
|
||||
$model = $this->create($data);
|
||||
$model->id = $id;
|
||||
return $model;
|
||||
return $this->fetchById($model->id);
|
||||
}
|
||||
protected function fetchOne(string $query, ?array $data = null): Define\Model
|
||||
{
|
||||
|
Reference in New Issue
Block a user