-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
47 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace oat\taoBackOffice\migrations; | ||
|
||
use Doctrine\DBAL\Schema\Schema; | ||
use Doctrine\Migrations\Exception\IrreversibleMigration; | ||
use oat\tao\model\featureFlag\FeatureFlagCheckerInterface; | ||
use oat\tao\model\menu\SectionVisibilityFilter; | ||
use oat\tao\scripts\tools\migrations\AbstractMigration; | ||
|
||
/** | ||
* Auto-generated Migration: Please modify to your needs! | ||
* | ||
* phpcs:disable Squiz.Classes.ValidClassName | ||
*/ | ||
final class Version202406131030273245_taoBackOffice extends AbstractMigration | ||
{ | ||
public function getDescription(): string | ||
{ | ||
return 'Hiding taoBo_remotelist and taoBo_tree sections in case solar design is enabled'; | ||
} | ||
|
||
public function up(Schema $schema): void | ||
{ | ||
/** @var SectionVisibilityFilter $sectionVisibilityFilter */ | ||
$sectionVisibilityFilter = $this->getServiceManager()->get(SectionVisibilityFilter::SERVICE_ID); | ||
|
||
$sectionVisibilityFilter->hideSectionByFeatureFlag( | ||
'taoBo_remotelist', | ||
FeatureFlagCheckerInterface::FEATURE_FLAG_SOLAR_DESIGN_ENABLED | ||
); | ||
$sectionVisibilityFilter->hideSectionByFeatureFlag( | ||
'taoBo_tree', | ||
FeatureFlagCheckerInterface::FEATURE_FLAG_SOLAR_DESIGN_ENABLED | ||
); | ||
|
||
$this->getServiceManager()->register(SectionVisibilityFilter::SERVICE_ID, $sectionVisibilityFilter); | ||
} | ||
|
||
public function down(Schema $schema): void | ||
{ | ||
throw new IrreversibleMigration(); | ||
} | ||
} |