Created
November 8, 2012 16:46
-
-
Save eggsurplus/4039986 to your computer and use it in GitHub Desktop.
Manifest Utils Directive in a SugarCRM Module - Function
This file contains hidden or 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
| // /extensions/application/utils/contract_products_utils.php | |
| function getProducts(){ | |
| static $products = null; | |
| if(!$products){ | |
| global $db; | |
| $query = "SELECT id, name FROM products where deleted = 0 order by name asc "; | |
| $result = $db->query($query, false); | |
| $products = array(); | |
| $products[''] = ''; | |
| while (($row = $db->fetchByAssoc($result)) != null) { | |
| $products[$row['id']] = $row['name']; | |
| } | |
| } | |
| return $products; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment