Optimize getRoutineType
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
This commit is contained in:
parent
17b37050d7
commit
48b68310a6
@ -3082,16 +3082,13 @@ class Privileges
|
||||
*/
|
||||
public function getRoutineType(string $dbname, string $routineName): string
|
||||
{
|
||||
$routineData = Routines::getDetails($this->dbi, $dbname);
|
||||
$routineName = mb_strtolower($routineName);
|
||||
$routineData = Routines::getDetails($this->dbi, $dbname, name: $routineName);
|
||||
|
||||
foreach ($routineData as $routine) {
|
||||
if (mb_strtolower($routine->name) === $routineName) {
|
||||
return $routine->type;
|
||||
}
|
||||
if ($routineData === []) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return '';
|
||||
return $routineData[0]->type;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user