Created
July 15, 2014 16:08
-
-
Save betobaz/f2e706fd50054a43ed98 to your computer and use it in GitHub Desktop.
SugarCRM::SugarQuery:: Join with custom module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$sugarQuery = new SugarQuery(); | |
$sugarQuery->select(array('id', 'name', 'precio')); | |
$precioBean = BeanFactory::newBean('MXC06_Precio'); | |
$sugarQuery->from($precioBean); | |
$sugarQuery->join('mxc06_precio_accounts'); | |
$sugarQuery->join('mxc06_precio_producttemplates'); | |
$sugarQuery->where() | |
->equals('mxc06_precio_accountsaccounts_ida', $pedido->cmx03_pedidos_accountsaccounts_ida) | |
->equals('mxc06_precio_producttemplatesproducttemplates_ida', $bean->cmx03_detallespedido_producttemplatesproducttemplates_ida); | |
$GLOBALS['log']->debug("QuoteLogicHook::getPrecio query:" . print_r($sugarQuery->compileSql(), true) ); | |
$result = $sugarQuery->execute(); |
Hi rszczypka,
what do you exactly need to do?
This is a little snippet, you can use it on jobs, logic hooks, apis.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I'm curious about this. Where do you keep this file and how do you use it?
I need to do a similar thing with custom modules.