| 1: | <?php |
| 2: | |
| 3: | namespace LaravelUi5\Core\Ui5; |
| 4: | |
| 5: | use LaravelUi5\Core\Enums\ArtifactType; |
| 6: | use LaravelUi5\Core\Infrastructure\Contracts\Ui5SourceStrategyInterface; |
| 7: | use LaravelUi5\Core\Ui5\Contracts\Ui5ModuleInterface; |
| 8: | |
| 9: | |
| 10: | |
| 11: | |
| 12: | |
| 13: | |
| 14: | |
| 15: | |
| 16: | |
| 17: | |
| 18: | |
| 19: | |
| 20: | abstract class AbstractUi5Module implements Ui5ModuleInterface |
| 21: | { |
| 22: | protected string $slug; |
| 23: | |
| 24: | protected Ui5SourceStrategyInterface $strategy; |
| 25: | |
| 26: | |
| 27: | |
| 28: | |
| 29: | |
| 30: | |
| 31: | |
| 32: | public function __construct(string $slug, Ui5SourceStrategyInterface $strategy) |
| 33: | { |
| 34: | $this->slug = $slug; |
| 35: | $this->strategy = $strategy; |
| 36: | } |
| 37: | |
| 38: | public function getType(): ArtifactType |
| 39: | { |
| 40: | return ArtifactType::Module; |
| 41: | } |
| 42: | |
| 43: | public function getSlug(): string |
| 44: | { |
| 45: | return $this->slug; |
| 46: | } |
| 47: | |
| 48: | public function getSourceStrategy(): Ui5SourceStrategyInterface |
| 49: | { |
| 50: | return $this->strategy; |
| 51: | } |
| 52: | |
| 53: | public function getAllArtifacts(): array |
| 54: | { |
| 55: | return [ |
| 56: | $this->getArtifactRoot(), |
| 57: | ...$this->getCards(), |
| 58: | ...$this->getKpis(), |
| 59: | ...$this->getTiles(), |
| 60: | ...$this->getActions(), |
| 61: | ...$this->getResources(), |
| 62: | ...$this->getReports(), |
| 63: | ...$this->getDashboards(), |
| 64: | ...$this->getDialogs(), |
| 65: | ]; |
| 66: | } |
| 67: | } |
| 68: | |