| 1: | <?php |
| 2: | |
| 3: | declare(strict_types=1); |
| 4: | |
| 5: | namespace LaravelUi5\OData\Edm\Vocabularies; |
| 6: | |
| 7: | /** |
| 8: | * Build-time catalog of vocabulary sources for the generator. |
| 9: | * |
| 10: | * This interface is consumed exclusively by the Artisan generator command. |
| 11: | * It defines the fixed, ordered set of vocabularies to process, including |
| 12: | * their remote URIs and their intended PHP namespace prefixes. |
| 13: | * |
| 14: | * The catalog imposes a resolution order. Every vocabulary must appear |
| 15: | * after all vocabularies it depends on, because the parser resolves |
| 16: | * cross-vocabulary type references as it processes each entry. The |
| 17: | * canonical order is: |
| 18: | * |
| 19: | * 1. Org.OData.Core.V1 (Core — no dependencies) |
| 20: | * 2. Org.OData.Validation.V1 (depends on Core) |
| 21: | * 3. Org.OData.Measures.V1 (depends on Core) |
| 22: | * 4. Org.OData.Aggregation.V1 (depends on Core) |
| 23: | * 5. Org.OData.Authorization.V1 (depends on Core) |
| 24: | * 6. Org.OData.Capabilities.V1 (depends on Core, Authorization) |
| 25: | * 7. com.sap.vocabularies.Common.v1 (depends on Core, Validation, Measures) |
| 26: | * 8. com.sap.vocabularies.UI.v1 (depends on Core, Common) |
| 27: | * 9. com.sap.vocabularies.Analytics.v1 (depends on Core, Common, Aggregation) |
| 28: | * 10. com.sap.vocabularies.Communication.v1 (depends on Core, Common) |
| 29: | * 11. com.sap.vocabularies.PersonalData.v1 (depends on Core, Common) |
| 30: | * |
| 31: | * This list is the recommended default. Implementations may restrict it |
| 32: | * to a subset relevant to the project. |
| 33: | * |
| 34: | * This interface must not be used in production application code. |
| 35: | * It belongs in the generator tooling only. |
| 36: | */ |
| 37: | interface VocabularyCatalogInterface |
| 38: | { |
| 39: | /** |
| 40: | * Returns the ordered list of vocabulary entries to generate. |
| 41: | * |
| 42: | * Entries must be ordered so that each vocabulary appears after all |
| 43: | * vocabularies it depends on. The generator processes entries in |
| 44: | * list order and will fail if a dependency is referenced before it |
| 45: | * has been processed. |
| 46: | * |
| 47: | * @return list<VocabularyEntryInterface> |
| 48: | */ |
| 49: | public function getEntries(): array; |
| 50: | |
| 51: | /** |
| 52: | * Returns the entry for the given OData namespace, or null when |
| 53: | * this catalog does not include that vocabulary. |
| 54: | */ |
| 55: | public function getEntry(string $namespace): ?VocabularyEntryInterface; |
| 56: | } |