add version delete/update restrictions

This commit is contained in:
Unknown 2018-05-14 01:03:18 +02:00
parent 24b0bb3798
commit 8f909821b6
1 changed files with 7 additions and 1 deletions

View File

@ -262,7 +262,7 @@ class meta extends Repo_i {
$versionData = $st->fetch();
if( !is_array($versionData) ){
if( !is_array($versionData) || $versionData["default"] == 1){
return false;
}
@ -306,6 +306,12 @@ class meta extends Repo_i {
}
public function updateVersion(int $version, ?String $label, ?bool $default) : bool{
//you can't un-default a version, you have to choose another version to be the default one
if($default == false){
return false;
}
$set = "";
$execute = [];