symfony - Doctrine2 Inheritance and querybuilder -


I am using inheritance with principle 2.1:

Fiche is the master unit and the artist Receives eFich

Such: Fetch - & gt;

  public function getCountAbonnes (\ MyApp \ FicheBundle \ Entity \ Fiche $ fiche) {$ qb = $ this- & gt; _em- & gt; CreateQueryBuilder (); $ Qb- & gt; Add ('Select', $ qb-> expr () - & gt; Count ('abonnement')); $ Qb- & gt; From ('\ Teelt \ FicheBundle \ Entity \ Abonnement', 'abonnement'); // !!!! This is the line problem !!!! $ Qb-> Where ('Fice', $ Fitch); Return $ qb- & gt; GetQuery () - & gt; Gates Civil Scale Results (); MyApp \ FicheBundle \ Entity \ Abonnement: Type: Unit Repository Class: MyApp \ FicheBundle \ Repository \ AbonnementRepository Table:   

Abonnement # For many users, many people have many people: users: targets Entity: MyApp \ UserBundle \ Entity \ User Inversion From: abonnements fiche: targetEntity: MyApp \ FicheBundle \ Entity \ Fiche inworld by: abonnements # etc ...

I have this problem That I always pass the artist unit instead of Fletcher, and I get this error:

Rakshar's expression 'Teletta' Fitch bundle 'existence' is not permitted 'in this context.

So I think that I should be fetched from my artist ... which is bad due to the same thing!

Thank you for your reply, it took me closer to the solution,

But in the end it seems that:

  $ qb-> Where ($ qb-> expr () -> gt ('abonnement.fhehe', $ fiche- & gt; getId ()));   

Was the solution

Is this normal? I think the mapping of the ID will be automated, but if I do not use getId (), then it returns to the toasting () version of my fetch and generates:

SELECT COUNT ( Sebnamen) From MyAppFicheBundle: Abonnement abonnement where abonnement.fiche = Miles Davis

[syntax error] line 0, call 100: error: the expected end of the string, 'Davis' found

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -