Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save maximecolin/75cbe517de5ab62a0bcac8bf457c92b7 to your computer and use it in GitHub Desktop.

Select an option

Save maximecolin/75cbe517de5ab62a0bcac8bf457c92b7 to your computer and use it in GitHub Desktop.

Revisions

  1. maximecolin created this gist May 2, 2016.
    24 changes: 24 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@


    /**
    * 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;
    }