Created
May 2, 2016 08:46
-
-
Save maximecolin/75cbe517de5ab62a0bcac8bf457c92b7 to your computer and use it in GitHub Desktop.
Doctrine hasJoin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Has join | |
* | |
* @param string $root | |
* @param string $relation | |
* | |
* @return bool | |
*/ | |
private function hasJoin($root, $relation) | |
{ | |
$parts = $this->getDQLPart('join'); | |
if (isset($parts[$root])) { | |
foreach ($parts[$root] as $join) { | |
if ($join instanceof Join && $join->getJoin() === sprintf('%s.%s', $root, $relation)) { | |
return true; | |
} | |
} | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment