|
iTx Technologies offre gratuitement
|
||
[Vue de la source] [Imprimer] [Statistique du projet]
(aucune description)
| Taille du fichier: | 5517 lignes (170 kb) |
| Inclus ou requis: | 3 fois |
| Réferencé: | 1 fois |
| Inclus ou requis: | 8 fichiers include/SugarPHPMailer.php modules/DynamicFields/templates/Fields/TemplateDate.php data/Link.php metadata/audit_templateMetaData.php include/CacheHandler.php modules/DynamicFields/DynamicField.php include/utils/encryption_utils.php include/VarDefHandler/listvardefoverride.php |
SugarBean:: (104 methods):
SugarBean()
getObjectName()
getAuditEnabledFieldDefinitions()
is_AuditEnabled()
get_audit_table_name()
create_audit_table()
getTableName()
getFieldDefinitions()
getIndices()
getFieldDefinition()
getPrimaryFieldDefinition()
getFieldValue()
populateDefaultValues()
removeRelationshipMeta()
remove_relationship_meta()
createRelationshipMeta()
create_relationship_meta()
load_relationship()
load_relationships()
get_linked_beans()
get_linked_fields()
get_importable_fields()
get_related_fields()
get_import_required_fields()
delete_linked()
create_tables()
drop_tables()
setupCustomFields()
cleanBean()
save()
has_been_modified_since()
get_notification_recipients()
send_assignment_notifications()
create_notification_email()
save_relationship_changes()
check_date_relationships_load()
preprocess_fields_on_save()
unformat_all_fields()
format_all_fields()
format_field()
retrieve()
populateFromRow()
add_list_count_joins()
create_list_count_query()
get_list()
process_order_by()
get_detail()
get_related_list()
get_union_related_list()
get_full_list()
create_new_list_query()
retrieve_parent_fields()
process_list_query()
_get_num_rows_in_query()
process_union_list_query()
process_detail_query()
process_full_list_query()
track_view()
get_summary_text()
fill_in_additional_list_fields()
fill_in_additional_detail_fields()
fill_in_additional_parent_fields()
fill_in_link_field()
fill_in_relationship_fields()
create_index()
mark_deleted()
mark_undeleted()
mark_relationships_deleted()
build_related_list()
build_related_list_where()
build_related_in()
build_related_list2()
list_view_parse_additional_sections()
get_list_view_array()
get_list_view_data()
get_where()
retrieve_by_string_fields()
process_special_fields()
build_generic_where_clause()
getRelatedFields()
parse_additional_headers()
assign_display_fields()
add_created_modified_dates()
set_relationship()
retrieve_relationships()
loadLayoutDefs()
call_custom_logic()
getRealKeyFromCustomFieldAssignedKey()
bean_implements()
ACLAccess()
isOwner()
getOwnerWhere()
listviewACLHelper()
toArray()
fromArray()
loadFromRow()
hasCustomFields()
create_qualified_order_by()
add_address_streets()
encrpyt_before_save()
decrypt_after_retrieve()
_checkOptimisticLocking()
_sendNotifications()
populateRelatedBean()
| SugarBean() X-Ref |
| Constructor for the bean, it performs following tasks: 1. Initalized a database connections 2. Load the vardefs for the module implemeting the class. cache the entries if needed 3. Setup row-level security preference All implementing classes must call this constructor using the parent::SugarBean() class. param: array $arr row of data fetched from the database. return: nothing |
| getObjectName() X-Ref |
| Returns the object name. If object_name is not set, table_name is returned. All implementing classes must set a value for the object_name variable. param: array $arr row of data fetched from the database. return: nothing |
| getAuditEnabledFieldDefinitions() X-Ref |
| Returns a list of fields with their definitions that have the audited property set to true. Before calling this function, check whether audit has been enabled for the table/module or not. You would set the audit flag in the implemting module's vardef file. return: an array of |
| is_AuditEnabled() X-Ref |
| Return true if auditing is enabled for this object You would set the audit flag in the implemting module's vardef file. return: boolean |
| get_audit_table_name() X-Ref |
| Returns the name of the audit table. Audit table's name is based on implementing class' table name. return: String Audit table name. |
| create_audit_table() X-Ref |
| If auditing is enabled, create the audit table. Function is used by the install scripts and a repair utility in the admin panel. Internal function, do not override. |
| getTableName() X-Ref |
| Returns the implementing class' table name. All implementing classes set a value for the table_name variable. This value is returned as the table name. If not set, table name is extracted from the implementing module's vardef. return: String Table name. |
| getFieldDefinitions() X-Ref |
| Returns field definitions for the implementing module. The definitions were loaded in the constructor. return: Array Field definitions. |
| getIndices() X-Ref |
| Returns index definitions for the implementing module. The definitions were loaded in the constructor. return: Array Index definitions. |
| getFieldDefinition($name) X-Ref |
| Returns field definition for the requested field name. The definitions were loaded in the constructor. param: string field name, return: Array Field properties or boolean false if the field doesn't exist |
| getPrimaryFieldDefinition() X-Ref |
| Returnss definition for the id field name. The definitions were loaded in the constructor. return: Array Field properties. |
| getFieldValue($name) X-Ref |
| Returns the value for the requested field. When a row of data is fetched using the bean, all fields are created as variables in the context of the bean and then fetched values are set in these variables. param: string field name, return: varies Field value. |
| populateDefaultValues($force=false) X-Ref |
| Aucune description |
| removeRelationshipMeta($key,$db,$tablename,$dictionary,$module_dir) X-Ref |
| Removes relationship metadata cache. Every module that has relationships defined with other modules, has this meta data cached. The cache is stores in 2 locations: relationships table and file system. This method clears the cache from both locations. param: string $key module whose meta cache is to be cleared. param: string $db database handle. param: string $tablename table name param: string $dictionary vardef for the module param: string $module_dir name of subdirectory where module is installed. return: Nothing |
| remove_relationship_meta($key,$db,$log,$tablename,$dictionary,$module_dir) X-Ref |
| This method has been deprecated. |
| createRelationshipMeta($key,$db,$tablename,$dictionary,$module_dir,$iscustom=false) X-Ref |
| Populates the relationship meta for a module. It is called during setup/install. It is used statically to create relationship meta data for many-to-many tables. param: string $key name of the object. param: object $db database handle. param: string $tablename table, meta data is being populated for. param: array dictionary vardef dictionary for the object. * param: string module_dir name of subdirectory where module is installed. param: boolean $iscustom Optional,set to true if module is installed in a custom directory. Default value is false. |
| create_relationship_meta($key,&$db,&$log,$tablename,$dictionary,$module_dir) X-Ref |
| This method has been deprecated. |
| load_relationship($rel_name) X-Ref |
| Loads the request relationship. This method should be called before performing any operations on the related data. This method searches the vardef array for the requested attribute's definition. If the attribute is of the type link then it creates a similary named variable and loads the relationship definition. param: string $rel_name relationship/attribute name. return: nothing. |
| load_relationships() X-Ref |
| Loads all attributes of type link. Method searches the implmenting module's vardef file for attributes of type link, and for each attribute create a similary named variable and load the relationship definition. return: Nothing |
| get_linked_beans($field_name,$bean_name, $sort_array = array() X-Ref |
| Returns an array of beans of related data. For instance, if an account is related to 10 contacts , this function will return an array of contacts beans (10) with each bean representing a contact record. Method will load the relationship if not done so already. param: string $field_name relationship to be loaded. param: string $bean name class name of the related bean. param: array $sort_array optional, unused param: int $begin_index Optional, default 0, unused. param: int $end_index Optional, default -1 param: int $deleted Optional, Default 0, 0 adds deleted=0 filter, 1 adds deleted=1 filter. param: string $optional_where, Optional, default empty. |
| get_linked_fields() X-Ref |
| Returns an array of fields that are of type link. return: array List of fields. |
| get_importable_fields() X-Ref |
| Returns an array of fields that are able to be Imported into i.e. 'importable' not set to 'false' return: array List of fields. |
| get_related_fields() X-Ref |
| Returns an array of fields that are of type relate. return: array List of fields. |
| get_import_required_fields() X-Ref |
| Returns an array of fields that are required for import return: array |
| delete_linked($id) X-Ref |
| Iterates through all the relationships and deletes all records for reach relationship. param: string $id Primary key value of the parent reocrd |
| create_tables() X-Ref |
| Creates tables for the module implementing the class. If you override this function make sure that your code can handles table creation. |
| drop_tables() X-Ref |
| Delete the primary table for the module implementing the class. If custom fields were added to this table/module, the custom table will be removed too, along with the cache entries that define the custom fields. |
| setupCustomFields($module_name, $clean_load=true) X-Ref |
| Loads the definition of custom fields defined for the module. Local file system cache is created as needed. param: string $module_name setting up custom fields for this module. param: boolean $clean_load Optional, default true, rebuilds the cache if set to true. |
| cleanBean() X-Ref |
| Cleans char, varchar, text, etc. fields of XSS type materials |
| save($check_notify = FALSE) X-Ref |
| Implements a generic insert and update logic for any SugarBean This method only works for subclasses that implement the same variable names. This method uses the presence of an id field that is not null to signify and update. The id field should not be set otherwise. param: boolean $check_notify Optional, default false, if set to true assignee of the record is notified via email. |
| has_been_modified_since($date, $modified_user_id) X-Ref |
| Performs a check if the record has been modified since the specified date param: date $date Datetime for verification param: string $modified_user_id User modified by |
| get_notification_recipients() X-Ref |
| Determines which users receive a notification |
| send_assignment_notifications($notify_user, $admin) X-Ref |
| Handles sending out email notifications when items are first assigned to users param: string $notify_user user to notify param: string $admin the admin user that sends out the notification |
| create_notification_email($notify_user) X-Ref |
| This function handles create the email notifications email. param: string $notify_user the user to send the notification email to |
| save_relationship_changes($is_update, $exclude=array() X-Ref |
| This function is a good location to save changes that have been made to a relationship. This should be overriden in subclasses that have something to save. param: $is_update true if this save is an update. |
| check_date_relationships_load() X-Ref |
| This function retrieves a record of the appropriate type from the DB. It fills in all of the fields from the DB into the object it was called on. param: $id - If ID is specified, it overrides the current value of $this->id. If not specified the current value of $this->id will be used. return: this - The object that it was called apon or null if exactly 1 record was not found. |
| preprocess_fields_on_save() X-Ref |
| This function processes the fields before save. Interal function, do not override. |
| unformat_all_fields() X-Ref |
| Removes formatting from values posted from the user interface. It only unformats numbers. Function relies on user/system prefernce for format strings. Internal Function, do not override. |
| format_all_fields() X-Ref |
| This functions adds formatting to all number fields before presenting them to user interface. Internal function, do not override. |
| format_field($fieldDef) X-Ref |
| Aucune description |
| retrieve($id = -1, $encode=true,$deleted=true) X-Ref |
| Function fetches a single row of data given the primary key value. The fetched data is then set into the bean. The function also processes the fetched data by formattig date/time and numeric values. param: string $id Optional, default -1, is set to -1 id value from the bean is used, else, passed value is used param: boolean $encode Optional, default true, encodes the values fetched from the database. param: boolean $deleted Optional, default true, if set to false deleted filter will not be added. |
| populateFromRow($row) X-Ref |
| Sets value from fetched row into the bean. param: array $row Fetched row |
| add_list_count_joins(&$query, $where) X-Ref |
| Add any required joins to the list count query. The joins are required if there is a field in the $where clause that needs to be joined. param: string $query param: string $where |
| create_list_count_query($query) X-Ref |
| Changes the select expression of the given query to be 'count(*)' so you can get the number of items the query will return. This is used to populate the upper limit on ListViews. param: string $query Select query string return: string count query |
| get_list($order_by = "", $where = "", $row_offset = 0, $limit=-1, $max=-1, $show_deleted = 0, $singleSelect=false) X-Ref |
| This function returns a paged list of the current object type. It is intended to allow for hopping back and forth through pages of data. It only retrieves what is on the current page. param: string $order_by param: string $where Additional where clause param: int $row_offset Optaional,default 0, starting row number param: init $limit Optional, default -1 param: int $max Optional, default -1 param: boolean $show_deleted Optioanl, default 0, if set to 1 system will show deleted records. return: array Fetched data. |
| process_order_by($order_by, $submodule) X-Ref |
| Prefixes column names with this bean's table name. This call can be ignored for mysql since it does a better job than Oracle in resolving ambiguity. param: string $order_by Order by clause to be processed param: string $submodule name of the module this order by clause is for return: string Processed order by clause |
| get_detail($order_by = "", $where = "", $offset = 0, $row_offset = 0, $limit=-1, $max=-1, $show_deleted = 0) X-Ref |
| Returns a detail object like retrieving of the current object type. It is intended for use in navigation buttons on the DetailView. It will pass an offset and limit argument to the sql query. param: string $order_by param: string $where Additional where clause param: int $row_offset Optaional,default 0, starting row number param: init $limit Optional, default -1 param: int $max Optional, default -1 param: boolean $show_deleted Optioanl, default 0, if set to 1 system will show deleted records. return: array Fetched data. |
| get_related_list($child_seed,$related_field_name, $order_by = "", $where = "",$row_offset = 0, $limit=-1, $max=-1, $show_deleted = 0) X-Ref |
| Fetches data from all related tables. param: object $child_seed param: string $related_field_name relation to fetch data for param: string $order_by Optional, default empty param: string $where Optional, additional where clause return: array Fetched data. |
| get_union_related_list($parentbean, $order_by = "", $sort_order='', $where = "",$row_offset = 0, $limit=-1, $max=-1, $show_deleted = 0, $subpanel_def) X-Ref |
| Constructs a query to fetch data for supanels and list views It constructs union queries for activities subpanel. param: Object $parentbean constructing queries for link attributes in this bean param: string $order_by Optional, order by clause param: string $sort_order Optional, sort order param: string $where Optional, additional where clause |
| get_full_list($order_by = "", $where = "", $check_dates=false, $show_deleted = 0) X-Ref |
| Returns a full (ie non-paged) list of the current object type. param: string $order_by the order by SQL parameter. defaults to "" param: string $where where clause. defaults to "" param: boolean $check_dates. defaults to false param: int $show_deleted show deleted records. defaults to 0 |
| create_new_list_query($order_by, $where,$filter=array() X-Ref |
| Return the list query used by the list views and export button. Next generation of create_new_list_query function. Override this function to return a custom query. param: string $order_by custom order by clause param: string $where custom where clause param: array $filter Optioanal param: array $params Optional * param: int $show_deleted Optional, default 0, show deleted records is set to 1. param: string $join_type param: boolean $return_array Optional, default false, response as array param: object $parentbean creating a subquery for this bean. param: boolean $singleSelect Optional, default false. return: String select query string, optionally an array value will be returned if $return_array= true. |
| retrieve_parent_fields($type_info) X-Ref |
| Returns parent record data for objects that store relationship information param: array $type_info |
| process_list_query($query, $row_offset, $limit= -1, $max_per_page = -1, $where = '') X-Ref |
| Processes the list query and return fetched row. Internal function, do not override. param: string $query select query to be processed. param: int $row_offset starting position param: int $limit Optioanl, default -1 param: int $max_per_page Optional, default -1 param: string $where Optional, additional filter criteria. return: array Fetched data |
| _get_num_rows_in_query($query, $is_count_query=false) X-Ref |
| Returns the number of rows that the given SQL query should produce Internal function, do not override. param: string $query valid select query param: boolean $is_count_query Optional, Default false, set to true if passed query is a count query. return: int count of rows found |
| process_union_list_query($parent_bean, $query,$row_offset, $limit= -1, $max_per_page = -1, $where = '', $subpanel_def, $query_row_count='', $secondary_queries = array() X-Ref |
| Applies pagination window to union queries used by list view and subpanels, executes the query and returns fetched data. Internal function, do not override. param: object $parent_bean param: string $query query to be processed. param: int $row_offset param: int $limit optional, default -1 param: int $max_per_page Optional, default -1 param: string $where Custom where clause. param: array $subpanel_def definition of sub-panel to be processed param: string $query_row_count param: array $seconday_queries return: array Fetched data. |
| process_detail_query($query, $row_offset, $limit= -1, $max_per_page = -1, $where = '', $offset = 0) X-Ref |
| Applies pagination window to select queries used by detail view, executes the query and returns fetched data. Internal function, do not override. param: string $query query to be processed. param: int $row_offset param: int $limit optional, default -1 param: int $max_per_page Optional, default -1 param: string $where Custom where clause. param: int $offset Optional, default 0 return: array Fetched data. |
| process_full_list_query($query, $check_date=false) X-Ref |
| Processes fetched list view data Internal function, do not override. param: string $query query to be processed. param: boolean $check_date Optional, default false. if set to true date time values are processed. return: array Fetched data. |
| track_view($user_id, $current_module, $current_view='') X-Ref |
| Tracks the viewing of a detail record. This leverages get_summary_text() which is object specific. Internal function, do not override. param: $user_id - String value of the user that is viewing the record. param: $current_module - String value of the module being processed. param: $current_view - String value of the current view |
| get_summary_text() X-Ref |
| Returns the summary text that should show up in the recent history list for this object. Internal function, do not override. |
| fill_in_additional_list_fields() X-Ref |
| This is designed to be overridden and add specific fields to each record. This allows the generic query to fill in the major fields, and then targeted queries to get related fields and add them to the record. The contact's account for instance. This method is only used for populating extra fields in lists. |
| fill_in_additional_detail_fields() X-Ref |
| This is designed to be overridden and add specific fields to each record. This allows the generic query to fill in the major fields, and then targeted queries to get related fields and add them to the record. The contact's account for instance. This method is only used for populating extra fields in the detail form |
| fill_in_additional_parent_fields() X-Ref |
| This is desgined to be overridden or called from extending bean. This method will fill in any parent_name fields. |
| fill_in_link_field( $linkFieldName ) X-Ref |
| Aucune description |
| fill_in_relationship_fields() X-Ref |
| Fill in fields where type = relate |
| create_index($query) X-Ref |
| This is a helper function that is used to quickly created indexes when creating tables. |
| mark_deleted($id) X-Ref |
| This function should be overridden in each module. It marks an item as deleted. If it is not overridden, then marking this type of item is not allowed |
| mark_undeleted($id) X-Ref |
| Restores data deleted by call to mark_deleted() function. Internal function, do not override. |
| mark_relationships_deleted($id) X-Ref |
| This function deletes relationships to this object. It should be overridden to handle the relationships of the specific object. This function is called when the item itself is being deleted. param: int $id id of the relationship to delete |
| build_related_list($query, &$template, $row_offset = 0, $limit = -1) X-Ref |
| This function is used to execute the query and create an array template objects from the resulting ids from the query. It is currently used for building sub-panel arrays. param: string $query - the query that should be executed to build the list param: object $template - The object that should be used to copy the records. param: int $row_offset Optional, default 0 param: int $limit Optional, default -1 return: array |
| build_related_list_where($query, &$template, $where='', $in='', $order_by, $limit='', $row_offset = 0) X-Ref |
| This function is used to execute the query and create an array template objects from the resulting ids from the query. It is currently used for building sub-panel arrays. It supports an additional where clause that is executed as a filter on the results param: string $query - the query that should be executed to build the list param: object $template - The object that should be used to copy the records. |
| build_related_in($query) X-Ref |
| Constructs an comma seperated list of ids from passed query results. param: string @query query to be executed. |
| build_related_list2($query, &$template, &$field_list) X-Ref |
| Optionally copies values from fetched row into the bean. Internal function, do not override. param: string $query - the query that should be executed to build the list param: object $template - The object that should be used to copy the records param: array $field_list List of fields. return: array |
| list_view_parse_additional_sections(&$list_form) X-Ref |
| Let implementing classes to fill in row specific columns of a list view form |
| get_list_view_array() X-Ref |
| Assigns all of the values into the template for the list view |
| get_list_view_data() X-Ref |
| Override this function to set values in the array used to render list view data. |
| get_where(&$fields_array) X-Ref |
| Construct where clause from a list of name-value pairs. |
| retrieve_by_string_fields($fields_array, $encode=true) X-Ref |
| Constructs a select query and fetch 1 row using this query, and then process the row Internal function, do not override. param: array @fields_array array of name value pairs used to construct query. param: boolean $encode Optional, default true, encode fetched data. return: object Instance of this bean with fetched data. |
| process_special_fields() X-Ref |
| This method is called during an import before inserting a bean Define an associative array called $special_fields the keys are user defined, and don't directly map to the bean's fields the value is the method name within that bean that will do extra processing for that field. example: 'full_name'=>'get_names_from_full_name' |
| build_generic_where_clause($value) X-Ref |
| Override this function to build a where clause based on the search criteria set into bean . |
| getRelatedFields($module, $id, $fields, $return_array = false) X-Ref |
| Aucune description |
| parse_additional_headers(&$list_form, $xTemplateSection) X-Ref |
| Aucune description |
| assign_display_fields($currentModule) X-Ref |
| Aucune description |
| add_created_modified_dates() X-Ref |
| Aucune description |
| set_relationship($table, $relate_values, $check_duplicates = true,$do_update=false,$data_values=null) X-Ref |
| Aucune description |
| retrieve_relationships($table, $values, $select_id) X-Ref |
| Aucune description |
| loadLayoutDefs() X-Ref |
| Aucune description |
| call_custom_logic($event, $arguments = null) X-Ref |
| Trigger custom logic for this module that is defined for the provided hook The custom logic file is located under custom/modules/[CURRENT_MODULE]/logic_hooks.php. That file should define the $hook_version that should be used. It should also define the $hook_array. The $hook_array will be a two dimensional array the first dimension is the name of the event, the second dimension is the information needed to fire the hook. Each entry in the top level array should be defined on a single line to make it easier to automatically replace this file. There should be no contents of this file that are not replacable. $hook_array['before_save'][] = Array(1, testtype, 'custom/modules/Leads/test12.php', 'TestClass', 'lead_before_save_1'); This sample line creates a before_save hook. The hooks are procesed in the order in which they are added to the array. The second dimension is an array of: processing index (for sorting before exporting the array) A logic type hook label/type php file to include php class the method is in php method to call The method signature for version 1 hooks is: function NAME(&$bean, $event, $arguments) $bean - $this bean passed in by reference. $event - The string for the current event (i.e. before_save) $arguments - An array of arguments that are specific to the event. |
| getRealKeyFromCustomFieldAssignedKey($name) X-Ref |
| Aucune description |
| bean_implements($interface) X-Ref |
| Aucune description |
| ACLAccess($view,$is_owner='not_set') X-Ref |
| Aucune description |
| isOwner($user_id) X-Ref |
| Returns true of false if the user_id passed is the owner param: GUID $user_id return: boolean |
| getOwnerWhere($user_id) X-Ref |
| Gets there where statement for checking if a user is an owner param: GUID $user_id return: STRING |
| listviewACLHelper() X-Ref |
| Used in order to manage ListView links and if they should links or not based on the ACL permissions of the user return: ARRAY of STRINGS |
| toArray($dbOnly = false, $stringOnly = false, $upperKeys=false) X-Ref |
| returns this bean as an array return: array of fields with id, name, access and category |
| fromArray($arr) X-Ref |
| Converts an array into an acl mapping name value pairs into files param: Array $arr |
| loadFromRow($arr) X-Ref |
| Loads a row of data into instance of a bean. The data is passed as an array to this function param: array $arr row of data fetched from the database. return: nothing |
| hasCustomFields() X-Ref |
| Aucune description |
| create_qualified_order_by( $order_by, $qualify) X-Ref |
| Ensure that fields within order by clauses are properly qualified with their tablename. This qualification is a requirement for sql server support. param: string $order_by original order by from the query param: string $qualify prefix for columns in the order by list. return: prefixed |
| add_address_streets($street_field) X-Ref |
| Combined the contents of street field 2 thru 4 into the main field param: string $street_field |
| encrpyt_before_save($value) X-Ref |
| Encrpyt and base64 encode an 'encrypt' field type in the bean using Blowfish. The default system key is stored in cache/Blowfish/{keytype} param: STRING value -plain text value of the bean field. return: string |
| decrypt_after_retrieve($value) X-Ref |
| Decode and decrypt a base 64 encoded string with field type 'encrypt' in this bean using Blowfish. param: STRING value - an encrypted and base 64 encoded string. return: string |
| _checkOptimisticLocking($action, $isUpdate) X-Ref |
| Moved from save() method, functionality is the same, but this is intended to handle Optimistic locking functionality. |
| _sendNotifications($check_notify) X-Ref |
| Send assignment notifications and invites for meetings and calls |
| populateRelatedBean(SugarBean $newbean) X-Ref |
| Called from ImportFieldSanitize::relate(), when creating a new bean in a related module. Will copies fields over from the current bean into the related. Designed to be overriden in child classes. param: SugarBean $newbean newly created related bean |
|
|
|
|