Skip to content

Commit

Permalink
Merge pull request #484 from oat-sa/feat/adf-1802/unique-identifier
Browse files Browse the repository at this point in the history
feat: better handling of unique IDs
  • Loading branch information
gabrielfs7 authored Nov 5, 2024
2 parents 86a3ae1 + ab08f01 commit 8be1e7f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
6 changes: 6 additions & 0 deletions models/classes/Copier/CopierServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ public function __invoke(ContainerConfigurator $configurator): void
[
tagged_iterator('tao.copier.permissions'),
]
)
->call(
'withEventManager',
[
service(EventManager::class),
]
);

$services
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
namespace oat\taoTests\models\Translation\Form\Modifier;

use core_kernel_classes_Literal;
use core_kernel_classes_Resource;
use oat\generis\model\data\Ontology;
use oat\tao\model\featureFlag\FeatureFlagCheckerInterface;
use oat\tao\model\form\Modifier\AbstractFormModifier;
Expand Down Expand Up @@ -55,9 +56,9 @@ public function modify(Form $form, array $options = []): void
$translationType = $instance->getOnePropertyValue(
$this->ontology->getProperty(TaoOntology::PROPERTY_TRANSLATION_TYPE)
);
$translationTypeUri = $translationType instanceof core_kernel_classes_Literal ?
(string)$translationType :
$translationType->getUri();
$translationTypeUri = $translationType instanceof core_kernel_classes_Literal
? (string) $translationType
: ($translationType instanceof core_kernel_classes_Resource ? $translationType->getUri() : null);

if (
empty($translationType)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
use oat\generis\model\data\Ontology;
use oat\generis\model\DependencyInjection\ContainerServiceProviderInterface;
use oat\oatbox\log\LoggerService;
use oat\tao\model\resources\Service\InstanceCopier;
use oat\tao\model\TaoOntology;
use oat\tao\model\featureFlag\FeatureFlagChecker;
use oat\tao\model\Translation\Form\Modifier\TranslationFormModifier as TaoTranslationFormModifier;
Expand All @@ -37,7 +38,6 @@
use oat\taoTests\models\Translation\Listener\TestCreatedEventListener;
use oat\taoTests\models\Translation\Service\TranslationPostCreationService;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use taoTests_models_classes_TestsService;

use function Symfony\Component\DependencyInjection\Loader\Configurator\service;

Expand Down Expand Up @@ -102,10 +102,10 @@ public function __invoke(ContainerConfigurator $configurator): void
$services
->get(TranslationCreationService::class)
->call(
'setOntologyClassService',
'setResourceTransfer',
[
TaoOntology::CLASS_URI_TEST,
service(taoTests_models_classes_TestsService::class)
service(InstanceCopier::class . '::TESTS')
]
)
->call(
Expand Down
5 changes: 5 additions & 0 deletions models/classes/event/TestDuplicatedEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,9 @@ public function jsonSerialize()
'cloneUri' => $this->cloneUri
];
}

public function getCloneUri(): string
{
return $this->cloneUri;
}
}

0 comments on commit 8be1e7f

Please sign in to comment.