data/BeanFactory.php

Show: inherited
Table of Contents

\BeanFactory

Package: SugarCRM

Factory to create SugarBeans

Api
 

Properties

Propertypublic  $hits= '0'
static
Default value0Details
Type
n/a
Propertyprotected  $loadOrder= 'array()'
static
Default valuearray()Details
Type
n/a
Propertyprotected  $loadedBeans= 'array()'
static
Default valuearray()Details
Type
n/a
Propertyprotected  $maxLoaded= '10'
static
Default value10Details
Type
n/a
Propertyprotected  $total= '0'
static
Default value0Details
Type
n/a
Propertyprotected  $touched= 'array()'
static
Default valuearray()Details
Type
n/a

Methods

methodpublicgetBean( String $module, String $id = null, Bool $encode = true, 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.

Parameters
Name Type Description
$module String
$id String
$encode Bool

@see SugarBean::retrieve

$deleted Bool

@see SugarBean::retrieve

Returns
Type Description
\SugarBean
Details
Static
 
methodpublicgetBeanName(  $module ) : void
static

Parameters
Name Type Description
$module
methodpublicgetObjectName( 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
Name Type Description
$module String
Returns
Type Description
bool
Details
Static
 
methodpublicnewBean(  $module ) : void
static

Parameters
Name Type Description
$module
methodpublicregisterBean( String $module, \SugarBean $bean, bool | String $id = false ) : bool
static

Parameters
Name Type Description
$module String
$bean \SugarBean
$id bool | String
Returns
Type Description
bool true if the bean registered successfully.
Details
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.  
Documentation was generated by DocBlox 0.18.1.