protected static function returnErrorIf($condition, $error)
 {
     if ($condition) {
         Actions::returnError($error);
     }
 }