2013-11-21 27 views
0

是什麼$bean代表在此代碼:

<?php 
    // prevents directly accessing this file from a web browser 
    if (!defined('sugarEntry') || !sugarEntry) 
     die('Not A Valid Entry Point'); 

    class Process { 

     function process(&$bean, $event) { 
      // calculate item profit 
      $bean->t_profit_c = ($bean->t_sale_price_c - $bean->t_item_cost_c); 

      // calculate sale profit 
      if (!empty($bean->t_qty_sold_c)) { 
       $bean->t_sale_profit_c = ($bean->t_qty_sold_c * $bean->t_profit_c); 
      } 
     } 
    } 
?> 

which I found here

,我還可以使用SQL查詢在這樣的代碼來獲得其他模塊的字段的內容到現場在其他?

+1

@FreshPrinceOfSO:看起來像你在這個代碼**位錯過了**位。 –

+1

'$ bean'是一個被引用傳入的對象...不能再告訴你了...... –

回答

3

$ bean是SugarCRM使用的一個對象或一組對象,以便用戶快速輕鬆地訪問數據庫信息。與他們一起工作應該是很容易:

how to using the bean instead of sql all the time

Sugar_Developer

在你的情況下,&$bean是一個對象,通過引用傳遞保存你給它的項目的所有屬性中的第3步你的鏈接。

+0

謝謝你的回答! – kpg9

相關問題