class AddressFieldHandler in CRM Core 8.2
Same name and namespace in other branches
- 8.3 modules/crm_core_match/src/Plugin/crm_core_match/field/AddressFieldHandler.php \Drupal\crm_core_match\Plugin\crm_core_match\field\AddressFieldHandler
- 8 modules/crm_core_match/src/Plugin/crm_core_match/field/AddressFieldHandler.php \Drupal\crm_core_match\Plugin\crm_core_match\field\AddressFieldHandler
Class for evaluating address field fields.
Implementation of FieldHandlerInterface for address field.
Hierarchy
- class \Drupal\crm_core_match\Plugin\crm_core_match\field\FieldHandlerBase implements ContainerFactoryPluginInterface, FieldHandlerInterface
- class \Drupal\crm_core_match\Plugin\crm_core_match\field\AddressFieldHandler
Expanded class hierarchy of AddressFieldHandler
File
- modules/
crm_core_match/ src/ Plugin/ crm_core_match/ field/ AddressFieldHandler.php, line 10
Namespace
Drupal\crm_core_match\Plugin\crm_core_match\fieldView source
class AddressFieldHandler extends FieldHandlerBase {
/**
* This function is going to add all addressfield components..
*
* @see DefaultMatchingEngineFieldType::fieldRender()
*/
public function fieldRender($field, $field_info, &$form) {
foreach ($field_info['columns'] as $item => $info) {
// This separation is rather logical than formal at the moment.
$text_items = array(
'name_line',
'first_name',
'last_name',
'organisation_name',
'administrative_area',
'sub_administrative_area',
'locality',
'dependent_locality',
'thoroughfare',
'premise',
'sub_premise',
);
$select_items = array(
'country',
'postal_code',
);
$field_item['field_name'] = $field['field_name'];
$field_item['label'] = $field['label'] . ': ' . $info['description'];
$field_item['bundle'] = $field['bundle'];
$field_item['field_item'] = $item;
if (in_array($item, $select_items)) {
$item = new SelectFieldHandler();
$item
->fieldRender($field_item, $field_info, $form);
}
if (in_array($item, $text_items)) {
$item = new textMatchField();
$item
->fieldRender($field_item, $field_info, $form);
}
}
}
/**
* {@inheritdoc}
*/
public function getOperators($property = 'value') {
return array(
'equals' => t('Equals'),
);
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AddressFieldHandler:: |
public | function | This function is going to add all addressfield components.. | |
AddressFieldHandler:: |
public | function |
Gets the operators. Overrides FieldHandlerInterface:: |
|
FieldHandlerBase:: |
protected | property | The settings. | 1 |
FieldHandlerBase:: |
protected | property | The plugin definition. | |
FieldHandlerBase:: |
protected | property | The field. | |
FieldHandlerBase:: |
protected | property | The plugin id. | |
FieldHandlerBase:: |
protected | property | A Contact query object. | |
FieldHandlerBase:: |
public static | function |
Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface:: |
|
FieldHandlerBase:: |
public | function |
Gets the property label. Overrides FieldHandlerInterface:: |
|
FieldHandlerBase:: |
public | function |
Gets the current selected operator. Overrides FieldHandlerInterface:: |
|
FieldHandlerBase:: |
public | function |
Gets the operator options. Overrides FieldHandlerInterface:: |
|
FieldHandlerBase:: |
public | function |
Returns the names of the field's subproperties. Overrides FieldHandlerInterface:: |
1 |
FieldHandlerBase:: |
public | function |
Gets the score. Overrides FieldHandlerInterface:: |
|
FieldHandlerBase:: |
public | function |
Gets the property status. Overrides FieldHandlerInterface:: |
|
FieldHandlerBase:: |
public | function |
Gets the field type. Overrides FieldHandlerInterface:: |
|
FieldHandlerBase:: |
public | function |
Gets the weight. Overrides FieldHandlerInterface:: |
|
FieldHandlerBase:: |
public | function |
Executes the match query. Overrides FieldHandlerInterface:: |
2 |
FieldHandlerBase:: |
constant | The weight. | ||
FieldHandlerBase:: |
public | function | Constructs an plugin instance. |