grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026 'ProspectLink', * 'link_file' => 'modules/Campaigns/ProspectLink.php'. * * @see Link::getJoin method * @param array $params * @param bool $return_array * @return array|string */ public function getJoin($params, $return_array = false) { $join_type = ' INNER JOIN '; if (isset($params['join_type'])) { $join_type = $params['join_type']; } $join = ''; $linkIsLHS = $this->getSide() == REL_LHS; if ( $this->_relationship->relationship_type == 'one-to-many' && $linkIsLHS ) { $table_with_alias = $table = $this->_relationship->rhs_table; $key = $this->_relationship->rhs_key; $module = $this->_relationship->rhs_module; $other_table = (empty($params['left_join_table_alias']) ? $this->_relationship->lhs_table : $params['left_join_table_alias']); $other_key = $this->_relationship->lhs_key; $alias_prefix = $table; if (!empty($params['join_table_alias'])) { $table_with_alias = $table.' '.$params['join_table_alias']; $table = $params['join_table_alias']; $alias_prefix = $params['join_table_alias']; } $join .= ' '.$join_type.' prospect_list_campaigns '.$alias_prefix.'_plc ON'; $join .= ' '.$alias_prefix.'_plc.'.$key.' = '.$other_table.'.'.$other_key."\n"; // join list targets $join .= ' '.$join_type.' prospect_lists_prospects '.$alias_prefix.'_plp ON'; $join .= ' '.$alias_prefix.'_plp.prospect_list_id = '.$alias_prefix.'_plc.prospect_list_id AND'; $join .= ' '.$alias_prefix.'_plp.related_type = '.DBManagerFactory::getInstance()->quoted($module)."\n"; // join target $join .= ' '.$join_type.' '.$table_with_alias.' ON'; $join .= ' '.$table.'.id = '.$alias_prefix.'_plp.related_id AND'; $join .= ' '.$table.'.deleted=0'."\n"; if ($return_array) { $ret_arr = array(); $ret_arr['join'] = $join; $ret_arr['type'] = $this->_relationship->relationship_type; if ($linkIsLHS) { $ret_arr['rel_key'] = $this->_relationship->join_key_rhs; } else { $ret_arr['rel_key'] = $this->_relationship->join_key_lhs; } return $ret_arr; } return $join; } else { return parent::getJoin($params, $return_array); } } }