metadata = $metadata; } /** * @return array */ public function getScopeList(): array { return array_keys($this->metadata->get('scopes') ?? []); } public function isScopeEntity(string $scope): bool { return (bool) $this->metadata->get(['scopes', $scope, 'entity']); } /** * @return array */ public function getScopeFieldList(string $scope): array { return array_keys($this->metadata->get(['entityDefs', $scope, 'fields']) ?? []); } /** * @return array */ public function getPermissionList(): array { $itemList = $this->metadata->get(['app', $this->type, 'valuePermissionList']) ?? []; return array_map( function (string $item): string { if (substr($item, -10) === 'Permission') { return substr($item, 0, -10); } return $item; }, $itemList ); } }