You are here

private function CFDefaultFieldComparator::getComparableProperties in Changed Fields API 7

Same name and namespace in other branches
  1. 7.3 src/FieldComparator/CFDefaultFieldComparator.php \CFDefaultFieldComparator::getComparableProperties()
  2. 7.2 includes/changed_fields.core.inc \CFDefaultFieldComparator::getComparableProperties()

Method that returns comparable properties for existing field type.

Parameters

$fieldType:

Return value

array

1 call to CFDefaultFieldComparator::getComparableProperties()
CFDefaultFieldComparator::compareFieldValues in includes/changed_fields.core.inc
Method that compares old and new field values.

File

includes/changed_fields.core.inc, line 259
changed_fields.core.inc file.

Class

CFDefaultFieldComparator
Class CFDefaultFieldComparator.

Code

private function getComparableProperties($fieldType) {
  switch ($fieldType) {
    case 'text_with_summary':
      $properties = array(
        'value',
        'summary',
      );
      break;
    case 'text':
    case 'text_long':
    case 'number_decimal':
    case 'number_float':
    case 'number_integer':
    case 'list_float':
    case 'list_integer':
    case 'list_boolean':
    case 'list_text':
    case 'phone':
      $properties = array(
        'value',
      );
      break;
    case 'taxonomy_term_reference':
      $properties = array(
        'tid',
      );
      break;
    case 'entityreference':
      $properties = array(
        'target_id',
      );
      break;
    case 'image':
      $properties = array(
        'fid',
        'width',
        'height',
      );
      break;
    case 'file':
      $properties = array(
        'fid',
      );
      break;
    case 'date':
    case 'datetime':
    case 'datestamp':
      $properties = array(
        'value',
        'timezone',
      );
      break;
    case 'email':
      $properties = array(
        'email',
      );
      break;
    case 'link_field':
      $properties = array(
        'url',
        'title',
      );
      break;
    default:
      $properties = $this
        ->getDefaultComparableProperties($fieldType);
      break;
  }
  return $properties;
}