data/BeanFactory.php
\BeanFactory
Package: SugarCRM
Parameters
Returns
Details
Factory to create SugarBeans
- Api
Properties
Methods
getBean(
String $module, String $id
=
null, Array $params
=
array(), Bool $deleted
=
true
)
:
\SugarBean
static
Returns a SugarBean object by id. The Last 10 loaded beans are cached in memory to prevent multiple retrieves per request.
If no id is passed, a new bean is created.
Name | Type | Description |
---|---|---|
$module | String | |
$id | String | |
$params | Array | A name/value array of parameters. Names: encode, deleted, disable_row_level_security If $params is boolean we revert to the old arguments (encode, deleted), and use $params as $encode. This will be changed to using only $params in later versions. |
$deleted | Bool | @see SugarBean::retrieve |
Type | Description |
---|---|
\SugarBean |
- Static
getObjectName(
String $module
)
:
bool
static
Returns the object name / dictionary key for a given module. This should normally be the same as the bean name, but may not for special case modules (ex. Case vs aCase)
Parameters
Returns
Details
Name | Type | Description |
---|---|---|
$module | String |
Type | Description |
---|---|
bool |
- Static
registerBean(
String $module, \SugarBean $bean, bool | String $id
=
false
)
:
bool
static
Parameters
Returns
Details
Name | Type | Description |
---|---|---|
$module | String | |
$bean | \SugarBean | |
$id | bool | String |
Type | Description |
---|---|
bool | true if the bean registered successfully. |
- Static
- This function registers a bean with the bean factory so that it can be access from accross the code without doing multiple retrieves. Beans should be registered as soon as they have an id.