Skip to content

Commit

Permalink
Merge pull request #63 from CPSB/patch-61
Browse files Browse the repository at this point in the history
Convert $id variables $primaryKey
  • Loading branch information
Tjoosten authored Nov 26, 2017
2 parents 8ae7a13 + 07a23a3 commit bf0643f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ActivismeBE/Repositories/Eloquent/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public function saveModel(array $data)
*/
public function update(array $data, $primaryKey, $attribute = "id")
{
return $this->model->where($attribute, '=', $id)->update($data);
return $this->model->where($attribute, '=', $primaryKey)->update($data);
}

/**
Expand All @@ -227,7 +227,7 @@ public function update(array $data, $primaryKey, $attribute = "id")
*/
public function updateRich(array $data, $primaryKey)
{
if (! ($model = $this->model->find($id))) {
if (! ($model = $this->model->find($primaryKey))) {
return false;
}

Expand Down Expand Up @@ -291,7 +291,7 @@ public function find($primaryKey, $columns = array('*'))
*/
public function findOrFail($primaryKey)
{
return $this->model->findOrFail($id);
return $this->model->findOrFail($primaryKey);
}

/**
Expand Down

0 comments on commit bf0643f

Please sign in to comment.