File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -1660,6 +1660,8 @@ public function from($from)
16601660 */
16611661 public function innerJoin ($ join , $ params = array ())
16621662 {
1663+ $ this ->checkIfCanJoin ();
1664+
16631665 if (is_array ($ params )) {
16641666 $ this ->_params ['join ' ] = array_merge ($ this ->_params ['join ' ], $ params );
16651667 } else {
@@ -1678,6 +1680,8 @@ public function innerJoin($join, $params = array())
16781680 */
16791681 public function leftJoin ($ join , $ params = array ())
16801682 {
1683+ $ this ->checkIfCanJoin ();
1684+
16811685 if (is_array ($ params )) {
16821686 $ this ->_params ['join ' ] = array_merge ($ this ->_params ['join ' ], $ params );
16831687 } else {
@@ -2177,4 +2181,17 @@ public function setDisableLimitSubquery($disableLimitSubquery)
21772181 {
21782182 $ this ->disableLimitSubquery = $ disableLimitSubquery ;
21792183 }
2184+
2185+ private function checkIfCanJoin ()
2186+ {
2187+ // Joins in Updates and Deletes are not SQL standard,
2188+ // Doctrine does not support them even on supporting databases:
2189+ // http://www.doctrine-project.org/jira/browse/DC-202
2190+ if ($ this ->getType () !== self ::SELECT ) {
2191+ trigger_error (
2192+ 'Joins are only supported with SELECTs ' ,
2193+ E_USER_DEPRECATED
2194+ );
2195+ }
2196+ }
21802197}
You can’t perform that action at this time.
0 commit comments