/**
  * Joins a ProjectActivity to it's external reference in a Doctrine Query.
  *
  * @param AIR2_Query $q
  * @param string  $alias
  */
 public static function joinRelated($q, $alias)
 {
     $a = $alias ? "{$alias}." : "";
     ProjectActivity::setupRelated();
     $q->leftJoin("{$a}Organization WITH {$a}pa_ref_type = ?", self::$REF_TYPE_ORG);
     $q->leftJoin("{$a}Inquiry WITH {$a}pa_ref_type = ?", self::$REF_TYPE_INQ);
 }