You are here

interface FieldHandlerInterface in CRM Core 8

Same name and namespace in other branches
  1. 8.3 modules/crm_core_match/src/Plugin/crm_core_match/field/FieldHandlerInterface.php \Drupal\crm_core_match\Plugin\crm_core_match\field\FieldHandlerInterface
  2. 8.2 modules/crm_core_match/src/Plugin/crm_core_match/field/FieldHandlerInterface.php \Drupal\crm_core_match\Plugin\crm_core_match\field\FieldHandlerInterface

Field Handler Interface.

Interface for defining the logical operators and query criteria used to identify duplicate contacts based on different field types in DefaultMatchingEngine.

Hierarchy

Expanded class hierarchy of FieldHandlerInterface

All classes that implement FieldHandlerInterface

1 file declares its use of FieldHandlerInterface
DefaultMatchingEngine.php in modules/crm_core_match/src/Plugin/crm_core_match/engine/DefaultMatchingEngine.php
1 string reference to 'FieldHandlerInterface'
crm_core_match.services.yml in modules/crm_core_match/crm_core_match.services.yml
modules/crm_core_match/crm_core_match.services.yml

File

modules/crm_core_match/src/Plugin/crm_core_match/field/FieldHandlerInterface.php, line 14

Namespace

Drupal\crm_core_match\Plugin\crm_core_match\field
View source
interface FieldHandlerInterface {

  /**
   * Returns the names of the field's subproperties.
   *
   * @return string[]
   *   The property names.
   */
  public function getPropertyNames();

  /**
   * Gets the property label.
   *
   * @param string $property
   *   The name of the property.
   *
   * @return string
   *   The property label.
   */
  public function getLabel($property = 'value');

  /**
   * Gets the property status.
   *
   * @param string $property
   *   The name of the property.
   *
   * @return bool
   *   The property status.
   */
  public function getStatus($property = 'value');

  /**
   * Gets the field type.
   *
   * @return string
   *   The name of the field type.
   */
  public function getType();

  /**
   * Gets the operators.
   *
   * Defines the logical operators that can be used by this field type.
   * Provides any additional fields needed to capture information used in
   * logical evaluations. See {@code QueryInterface::condition} for valid
   * operators.
   *
   * For instance: if this was a text field, there might be 4 logical operators:
   * =, STARTS_WITH, ENDS_WITH and CONTAINS.
   *
   * @param string $property
   *   The name of the property.
   *
   * @return string[]
   *   Array of operators, with the operator name as key and the translated
   *   operator label as value.
   */
  public function getOperators($property = 'value');

  /**
   * Gets the current selected operator.
   *
   * @param string $property
   *   The name of the property.
   *
   * @return string
   *   The operator name.
   *
   * @see FieldHandlerInterface::getOperators()
   */
  public function getOperator($property = 'value');

  /**
   * Gets the operator options.
   *
   * @param string $property
   *   The name of the property.
   *
   * @return string
   *   The operator options.
   *
   * @see FieldHandlerInterface::getOperators()
   * @see FieldHandlerInterface::getOperator()
   * @todo: Consider using options when matching or drop.
   */
  public function getOptions($property = 'value');

  /**
   * Gets the score.
   *
   * @param string $property
   *   The name of the property.
   *
   * @return int
   *   The score.
   */
  public function getScore($property = 'value');

  /**
   * Gets the weight.
   *
   * @param string $property
   *   The name of the property.
   *
   * @return int
   *   The weight.
   */
  public function getWeight($property = 'value');

  /**
   * Executes the match query.
   *
   * @param \Drupal\crm_core_contact\ContactInterface $contact
   *   The contact entity to find matches for.
   * @param string $property
   *   The name of the property.
   *
   * @return array
   *   An array containing the found matches.
   *   The first level keys are the contact ids found as matches.
   *   The second level key is the rule id responsible for the match containing
   *   its score as value.
   *
   * @code
   *   array(
   *     $contact_id => array(
   *       $rule_id => $core,
   *     ),
   *   );
   * @end
   */
  public function match(ContactInterface $contact, $property = 'value');

}

Members

Namesort descending Modifiers Type Description Overrides
FieldHandlerInterface::getLabel public function Gets the property label. 1
FieldHandlerInterface::getOperator public function Gets the current selected operator. 1
FieldHandlerInterface::getOperators public function Gets the operators. 7
FieldHandlerInterface::getOptions public function Gets the operator options. 1
FieldHandlerInterface::getPropertyNames public function Returns the names of the field's subproperties. 1
FieldHandlerInterface::getScore public function Gets the score. 1
FieldHandlerInterface::getStatus public function Gets the property status. 1
FieldHandlerInterface::getType public function Gets the field type. 1
FieldHandlerInterface::getWeight public function Gets the weight. 1
FieldHandlerInterface::match public function Executes the match query. 1