{"id":1325,"date":"2022-08-30T15:15:35","date_gmt":"2022-08-30T15:15:35","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/10\/zend-doctrine-error-on-table-relationship-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:15:35","modified_gmt":"2022-08-30T15:15:35","slug":"zend-doctrine-error-on-table-relationship-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/zend-doctrine-error-on-table-relationship-collection-of-common-programming-errors\/","title":{"rendered":"Zend + Doctrine Error on Table relationship-Collection of common programming errors"},"content":{"rendered":"<p>what is the best practice of joining table (left join) syntax in doctrine?<\/p>\n<p>I have this code:<\/p>\n<pre><code>    $userTable = Doctrine_Core::getTable('Application_Model_User');\n\n    $q = Doctrine_Query::create()\n            -&gt;select('u.*')\n            -&gt;from('Application_Model_User2 u')\n            -&gt;leftJoin('u.Application_Model_User2 p');\n\n    echo $q-&gt;getSqlQuery();\n<\/code><\/pre>\n<p>but what I get is this error:<\/p>\n<pre><code>    Message: Unknown relation alias Application_Model_User2\n<\/code><\/pre>\n<p>PS: Application_Model_User and Application_Model_User2 extends the generated model by the doctrine.<\/p>\n<p>Does someone have any idea with regards to this error?<\/p>\n<p id=\"rop\"><small>Originally posted 2013-11-10 00:16:59. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>what is the best practice of joining table (left join) syntax in doctrine? I have this code: $userTable = Doctrine_Core::getTable(&#8216;Application_Model_User&#8217;); $q = Doctrine_Query::create() -&gt;select(&#8216;u.*&#8217;) -&gt;from(&#8216;Application_Model_User2 u&#8217;) -&gt;leftJoin(&#8216;u.Application_Model_User2 p&#8217;); echo $q-&gt;getSqlQuery(); but what I get is this error: Message: Unknown relation alias Application_Model_User2 PS: Application_Model_User and Application_Model_User2 extends the generated model by the doctrine. Does someone [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1325","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1325","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1325"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1325\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1325"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1325"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1325"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}