Skip to content

Instantly share code, notes, and snippets.

@jmertic
Created March 9, 2011 19:26
Show Gist options
  • Save jmertic/862793 to your computer and use it in GitHub Desktop.
Save jmertic/862793 to your computer and use it in GitHub Desktop.
<?php
if (!defined('sugarEntry') || !sugarEntry)
die('Not A Valid Entry Point');
require_once 'modules/Accounts/Account.php';
class AccountDetailView extends Account {
function AccountDetailView() {
parent::Account();
}
function get_all_meetings_related() {
$return_array['select'] = " SELECT meetings.id ";
$return_array['from'] = " FROM meetings ";
$return_array['join'] = " JOIN meetings_contacts ON meetings.id = meetings_contacts.meeting_id ";
$return_array['join'] .= " JOIN accounts_contacts ON meetings_contacts.contact_id = accounts_contacts.contact_id";
$return_array['where'] = " accounts_contacts.account_id = '" . $this->id . "'";
return $return_array;
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment