This commit is contained in:
2021-03-24 15:53:49 +08:00
parent fea6ede406
commit a86d648360
+20
View File
@@ -90,6 +90,26 @@ class Producer extends Component
}
/**
* @return array
*/
public function getService(): array
{
$array = [];
foreach (array_keys($this->cods) as $key) {
$explode = explode('.', $key);
$prefix = array_shift($explode);
$explode = implode('.', $explode);
if (!isset($array[$prefix])) {
$array[$prefix] = [];
}
$array[$prefix][] = $explode;
}
return $array;
}
/**
* @param string $name
* @return mixed