Skip to content

Commit

Permalink
drop duplicate function updateWorkshop
Browse files Browse the repository at this point in the history
  • Loading branch information
tpokorra committed Dec 23, 2020
1 parent 1235c3e commit 58b8765
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions src/classes/DBO.php
Original file line number Diff line number Diff line change
Expand Up @@ -1092,37 +1092,6 @@ public function updateWorkshop($workshop, $name, $description, $published) {
$query->execute();
}

/**
* Updates the given workshop with the given name, description, and
* "published" value.
*
* @param int $workshop The workshop id of the workshop to update
* @param string $name The new name for the workshop
* @param string $description The new description for the workshop
* @param int $published The new "published" value. If empty($published) returns true, it will be set to 0, otherwise 1.
*/
public function updateWorkshop($workshop, $name, $description, $published) {
$sql = 'UPDATE `workshop`
SET `name` = :name,
`description` = :description,
`published` = :published
WHERE `id` = :workshop_id';

if (empty($published)) {
$published = 0;
}
else {
$published = 1;
}

$query=$this->db->prepare($sql);
$query->bindValue(':workshop_id', (int) $workshop, PDO::PARAM_INT);
$query->bindValue(':published', (int) $published, PDO::PARAM_INT);
$query->bindValue(':name', $name, PDO::PARAM_STR);
$query->bindValue(':description', $description, PDO::PARAM_STR);
$query->execute();
}

/**
* Checks if location IDs are consecutive, starting with id 0. TODO: Note
* this is naieve, if location IDs starts with < 0, it won't be caught
Expand Down

0 comments on commit 58b8765

Please sign in to comment.