Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: unique identifiers #4124

Merged
merged 4 commits into from
Nov 6, 2024
Merged

Conversation

shpran
Copy link
Contributor

@shpran shpran commented Nov 6, 2024

Fix for unique identifiers + removing unnecessary classes

@shpran shpran requested a review from gabrielfs7 November 6, 2024 01:00
{
public function getOriginalResourceUri(core_kernel_classes_Resource $resource): ?string
{
$property = $resource->getProperty(TaoOntology::PROPERTY_TRANSLATION_ORIGINAL_RESOURCE_URI);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the value of this class, but some points:

  • It will be the first time we are creating a class to shortcut ontology getProperty...
  • If we keep calling $resource->getProperty all the time in a loop or other places, this is actually a performance issue. We would have to cache it.

$this->featureFlagChecker = $featureFlagChecker;
}

public function retrieve(core_kernel_classes_Resource $resource): ?string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the value of this class, but some points:

  • It will be the first time we are creating a class to shortcut ontology getProperty...
  • If we keep calling $resource->getProperty all the time in a loop or other places, this is actually a performance issue. We would have to cache it.
  • If this is a uniqueId retriever, shouldn't it contain the logic to get the unique id in any case? Calling the Proxy you created?

Copy link
Contributor

@gabrielfs7 gabrielfs7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pre-approved as the expected behavior is working.

Test and styling will be fixed in the integration branch

$this->qtiIdentifierSetters[$resourceType] = $qtiIdentifierSetter;
}

public function __invoke(core_kernel_classes_Resource $item): void
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should call it more agnostically $resource

Suggested change
public function __invoke(core_kernel_classes_Resource $item): void
public function __invoke(core_kernel_classes_Resource $resource): void

@shpran shpran merged commit 9f385e6 into feat/HKD-6/integration Nov 6, 2024
1 check passed
@shpran shpran deleted the fix/hkd-6/unique-identifiers branch November 6, 2024 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants