| 1: | <?php |
| 2: | |
| 3: | declare(strict_types=1); |
| 4: | |
| 5: | namespace LaravelUi5\OData\Edm\Vocabularies; |
| 6: | |
| 7: | use LaravelUi5\OData\Edm\Contracts\ReferenceInterface; |
| 8: | use LaravelUi5\OData\Edm\IncludedSchema; |
| 9: | use LaravelUi5\OData\Edm\Reference; |
| 10: | |
| 11: | |
| 12: | |
| 13: | |
| 14: | |
| 15: | |
| 16: | |
| 17: | |
| 18: | |
| 19: | |
| 20: | |
| 21: | final readonly class VocabularyEntry implements VocabularyEntryInterface |
| 22: | { |
| 23: | |
| 24: | |
| 25: | |
| 26: | public function __construct( |
| 27: | private string $namespace, |
| 28: | private string $alias, |
| 29: | private string $uri, |
| 30: | private string $phpNamespace, |
| 31: | private array $dependencies, |
| 32: | ) {} |
| 33: | |
| 34: | public function getNamespace(): string |
| 35: | { |
| 36: | return $this->namespace; |
| 37: | } |
| 38: | |
| 39: | public function getAlias(): string |
| 40: | { |
| 41: | return $this->alias; |
| 42: | } |
| 43: | |
| 44: | public function getUri(): string |
| 45: | { |
| 46: | return $this->uri; |
| 47: | } |
| 48: | |
| 49: | public function getPhpNamespace(): string |
| 50: | { |
| 51: | return $this->phpNamespace; |
| 52: | } |
| 53: | |
| 54: | |
| 55: | public function getDependencies(): array |
| 56: | { |
| 57: | return $this->dependencies; |
| 58: | } |
| 59: | |
| 60: | public function toReference(): ReferenceInterface |
| 61: | { |
| 62: | return new Reference( |
| 63: | uri: $this->uri, |
| 64: | includes: [new IncludedSchema(namespace: $this->namespace, alias: $this->alias)], |
| 65: | ); |
| 66: | } |
| 67: | } |
| 68: | |