Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Marco Matta
Added: Sep 2, 2021 12:52 PM
Views: 300
Tags: sugarcrm
  1. //newBean() - to create a new, empty SugarBean
  2. $bean = BeanFactory::newBean($module);
  3. //newBeanByName() - to fetch a bean by its beanList name
  4. $bean = BeanFactory::newBeanByName($name);
  5. //getBean() - to retrieve a specific record from the database
  6. $bean = BeanFactory::getBean($module, $record_id);
  7. $bean = BeanFactory::getBean($module, $record_id, array('disable_row_level_security' => true));
  8. //retrieveBean() - can also be used to retrieve a specific record from the database
  9. // on failure, null will be returned instead of an empty bean object
  10. $bean = BeanFactory::retrieveBean($module, $record_id);
  11. $bean = BeanFactory::retrieveBean($module, $record_id, array('disable_row_level_security' => true));
  12. //getObjectName() - will return the object name / dictionary key for a given module
  13. $moduleKey = BeanFactory::getObjectName($moduleName);
  14. //getBeanName()
  15. $moduleClass = BeanFactory::getBeanName($module);