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

Selectables do not work? #653

Closed
ostrolucky opened this issue Apr 3, 2025 · 4 comments
Closed

Selectables do not work? #653

ostrolucky opened this issue Apr 3, 2025 · 4 comments

Comments

@ostrolucky
Copy link

/**
 * @ORM\OneToMany(targetEntity="App\QualityCheck\Domain\Model\CheckResult", mappedBy="subnet")
 */
private Collection&Selectable $qualityCheckResults;
  174    Property App\ManagedProxies\Domain\Subnet\Subnet::$qualityCheckResults type mapping mismatch: property can contain
         Doctrine\Common\Collections\Collection&Doctrine\Common\Collections\Selectable but database expects
         Doctrine\Common\Collections\Collection&iterable<App\QualityCheck\Domain\Model\CheckResult>.
         🪪  doctrine.associationType

Does this extension not know about Selectables?

@ondrejmirtes
Copy link
Member

You should be getting some missingType.generics errors for this code on level 6+.

Try specifying generics for the property type with @var.

@ostrolucky
Copy link
Author

We don't use level 6 (not like it matters with this extension). Anyways, still no budge with generics specified

/**
     * @ORM\OneToMany(targetEntity="App\QualityCheck\Domain\Model\CheckResult", mappedBy="subnet")
     * @var Collection&Selectable<int, CheckResult>
     */
    private Collection&Selectable $qualityCheckResults;
  175    Property App\ManagedProxies\Domain\Subnet\Subnet::$qualityCheckResults type mapping mismatch: property can contain
         Doctrine\Common\Collections\Collection&Doctrine\Common\Collections\Selectable<int, App\QualityCheck\Domain\Model\CheckResult> but database expects
         Doctrine\Common\Collections\Collection&iterable<App\QualityCheck\Domain\Model\CheckResult>.
         🪪  doctrine.associationType

@ondrejmirtes
Copy link
Member

What about:

Collection<CheckResult>&Selectable<int, CheckResult>

Or:

Collection<int, CheckResult>&Selectable<int, CheckResult>

@ostrolucky
Copy link
Author

Indeed, that seem to work

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

No branches or pull requests

2 participants