mirror of
https://koodu.h-i.works/projects/thebadspace
synced 2025-06-25 16:04:37 -05:00
consolidated getLocation function
changed the function that retrieves a single location to decide what to get based on the variable type, so it doesn't need to be two seperate functions
This commit is contained in:
@ -34,9 +34,13 @@ class LocationRepository
|
||||
return $results;
|
||||
}
|
||||
|
||||
public function getLocation($uuid)
|
||||
public function getLocation($type)
|
||||
{
|
||||
return $this->model::where("uuid", $uuid)->first();
|
||||
if (!is_string($type) || (preg_match('/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/', $type) !== 1)) {
|
||||
return $this->model::where("url", $type)->first();
|
||||
} else {
|
||||
return $this->model::where("uuid", $type)->first();
|
||||
}
|
||||
}
|
||||
|
||||
public function getActiveLocations()
|
||||
|
Reference in New Issue
Block a user