| 1: | <?php |
| 2: | |
| 3: | namespace LaravelUi5\Core\Ui5; |
| 4: | |
| 5: | use Flat3\Lodata\Endpoint; |
| 6: | use LaravelUi5\Core\Introspection\App\Ui5AppSource; |
| 7: | use LaravelUi5\Core\Ui5\Contracts\Ui5AppInterface; |
| 8: | use LaravelUi5\Core\Ui5\Contracts\Ui5ModuleInterface; |
| 9: | use LaravelUi5\Core\Ui5CoreServiceProvider; |
| 10: | |
| 11: | abstract class AbstractUi5App extends Endpoint implements Ui5AppInterface |
| 12: | { |
| 13: | public function __construct(protected Ui5ModuleInterface $module) |
| 14: | { |
| 15: | parent::__construct(Ui5CoreServiceProvider::ODATA_ROUTE_PREFIX, $module->getName(), $this->getVersion()); |
| 16: | } |
| 17: | |
| 18: | public function getModule(): Ui5ModuleInterface |
| 19: | { |
| 20: | return $this->module; |
| 21: | } |
| 22: | |
| 23: | public function getSource(): Ui5AppSource |
| 24: | { |
| 25: | return $this->module->getSourceStrategy()->createAppSource($this->getVendor()); |
| 26: | } |
| 27: | |
| 28: | public function getManifestPath(): string |
| 29: | { |
| 30: | return $this->module->getSourceStrategy()->getSourcePath() . '/manifest.json'; |
| 31: | } |
| 32: | } |
| 33: | |