/** * Joins a SrcActivity 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}." : ""; SrcActivity::setupRelated(); $q->leftJoin("{$a}SrcResponseSet WITH {$a}sact_ref_type = ?", self::$REF_TYPE_RESPONSE); $q->leftJoin("{$a}Tank WITH {$a}sact_ref_type = ?", self::$REF_TYPE_TANK); $q->leftJoin("{$a}Organization WITH {$a}sact_ref_type = ?", self::$REF_TYPE_ORG); $q->leftJoin("{$a}Inquiry WITH {$a}sact_ref_type = ?", self::$REF_TYPE_INQUIRY); $q->leftJoin("{$a}Email WITH {$a}sact_ref_type = ?", self::$REF_TYPE_EMAIL); }