ORM is not returning the correct objects #11161
Unanswered
elliotlgn
asked this question in
Support Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, i'm on symfony 6.3 and using Doctrine ORM.
My architecture is :
TEST(TESTID) | RUBRIQUE(TESTID,RUBRIQUEID) | QUESTION(TESTID,RUBRIQUEID,QUESTIONID)
I'm trying to fetch all the question i have in my app (with the TESTID 94) with this request : $questions = $this->manager->getRepository(Question::class)->findby(['TESTID' => 94]);.
Why it return : array:2 [▼
0 => App\Entity\Question {[#5869 ▼]/test/duplicate/94#)
-QUESTIONID: 1
-TESTID: App\Entity\Test {#638 ▶}
-RUBRIQUEID: App\Entity\Rubrique {[#5964 ▶]/duplicate/94#)}
-REFQUESTION: "Qt 1"
}
1 => App\Entity\Question {#5869 ▼
-QUESTIONID: 1
-TESTID: App\Entity\Test {#638 ▶}
-RUBRIQUEID: App\Entity\Rubrique {#5964 ▶}
-REFQUESTION: "Qt 1"
}
]
I have 2 questions, but it returns the same question 2 times (TESTID = 94 , RUBRIQUEID = 1) why don't I have the question(TESTID = 94 , RUBRIQUEID = 2) too?
beacause in my database i have :
question1(TESTID = 94 , RUBRIQUEID = 1, REFQUESTION: "Qt 1") ,
question2(TESTID = 94 , RUBRIQUEID = 2, REFQUESTION: "Question 1")
Beta Was this translation helpful? Give feedback.
All reactions