Kohana Doctrine_Query returning larger result set than requested
I am really struggling trying to figure out why I am getting more rows
back than I am looking for with this function. It seems fairly straight
forward, get what matches the account_id attribute.
The updateVMTables function executes an external command which inserts the
result into the database first. I end up getting the entire table rather
than the query result set expected from matching $domain. The data in the
domain column looks like voicemail_1 and so on.
Maybe I'm just tired and overlooking it. :) lol
Controller:
public function index() {
$account_id = users::getAttr('account_id');
$domain = 'voicemail_' .$account_id;
$mailboxes = VoicemailManager::getMailboxes($account_id);
try {
foreach ( $mailboxes as $mailbox ) {
VoicemailManager::updateVMTables($mailbox['mailbox'], $domain);
}
} catch(Exception $e) {
$this->template->content = new View('voicemailviewer/unexpected');
$this->template->content->unexpected_msg = $e->getMessage();
return TRUE;
}
Function from lib:
public static function getMailboxes($account_id, $user_id = NULL) {
$q = Doctrine_Query::create()
->select('v.mailbox')
->from('Voicemail v')
->where('v.account_id = ?');
return $q->execute($account_id, Doctrine::HYDRATE_ARRAY);
}
No comments:
Post a Comment