All Data Structures Functions Variables Pages
Public Member Functions | Protected Member Functions | Protected Attributes
DedupeRules Class Reference
Inheritance diagram for DedupeRules:
AccountDedupeRules ContactDedupeRules

Public Member Functions

 __construct (RedBeanModel $model)
 
 getDedupeViewClassName ()
 
 registerScriptForEditAndDetailsView (Element $element)
 
 searchForDuplicateModels ($attribute, $value)
 

Protected Member Functions

 getDedupeAttributesAndRelatedAttributesMappedArray ()
 
 getDedupeElements ()
 
 getDedupeAttributesAndSearchForDuplicateModelsCallbackMappedArray ()
 
 getInputIdForDedupe (Element $element)
 
 getAttributeForDedupe (Element $element)
 
 getRelatedAttributeForDedupe (Element $element)
 
 getElementNameByElement (Element $element)
 
 shouldCreateScriptForElement (Element $element)
 
 getCallbackToSearchForDuplicateModelsByAttribute ($attribute)
 

Protected Attributes

 $model
 

Detailed Description

Class DedupeRules Base class of dedupe rules that assist Extend this class to make a set of DedupeRules that is for a specific model.

Definition at line 42 of file DedupeRules.php.

Member Function Documentation

getDedupeAttributesAndRelatedAttributesMappedArray ( )
protected

This array should map the relation between the attribute and related attribute that should trigger the dedupe

Returns
array

Definition at line 55 of file DedupeRules.php.

getDedupeElements ( )
protected

This array contains a list of the Element names that will trigger the dedupe

Returns
array

Definition at line 64 of file DedupeRules.php.

getDedupeAttributesAndSearchForDuplicateModelsCallbackMappedArray ( )
protected

This array maps the relation between the attribute name and function callback for search for duplicate models

Returns
array

Definition at line 73 of file DedupeRules.php.

getDedupeViewClassName ( )

The ViewClassName used to display the results of the dedupe models list

Returns
string

Definition at line 82 of file DedupeRules.php.

registerScriptForEditAndDetailsView ( Element  $element)

Register the script that will make the ajax call to search for a dedupe and update the DedupeViewClassName with the content returned. It also display a clickable flash message with the number of results found

See Also
ZurmoModuleController::actionSearchForDuplicateModels
Parameters
Element$element
Returns
null

Definition at line 94 of file DedupeRules.php.

getInputIdForDedupe ( Element  $element)
protected

Returns the input id that should be used to trigger the dedupe

Parameters
Element$element
Returns
null|string

Definition at line 170 of file DedupeRules.php.

getAttributeForDedupe ( Element  $element)
protected

Returns the attribute name that should be used to trigger the dedupe

Parameters
Element$element
Returns
mixed
Exceptions
NotSupportedException

Definition at line 189 of file DedupeRules.php.

getRelatedAttributeForDedupe ( Element  $element)
protected

Return the related attribute that should be used to trigger the dedupe

Parameters
Element$element
Returns
mixed

Definition at line 213 of file DedupeRules.php.

getElementNameByElement ( Element  $element)
protected

Returns the name of the element

Parameters
Element$element
Returns
string

Definition at line 224 of file DedupeRules.php.

shouldCreateScriptForElement ( Element  $element)
protected

Based on the Element the data from

See Also
DedupeRules::getDedupeAttributesAndRelatedAttributesMappedArray and
DedupeRules::getDedupeElements and from the model id, decided if the script for dedupe should be registered
Parameters
Element$element
Returns
bool

Definition at line 236 of file DedupeRules.php.


The documentation for this class was generated from the following file:
Generated on Mon Jan 27 2020 07:10:36