Example #1
0
 /**
  *
  * {@inheritdoc}
  *
  */
 public static function buildObjectArray(DataField $data, array &$out)
 {
     if (!$data->getFieldType()->getDeleted()) {
         switch ($data->getFieldType()->getDisplayOptions()['encryption']) {
             case 'md5':
                 $out[$data->getFieldType()->getName()] = md5($data->getTextValue());
                 break;
             default:
                 $out[$data->getFieldType()->getName()] = sha1($data->getTextValue());
                 break;
         }
     }
 }
Example #2
0
 /**
  * Build an array representing the object, this array is ready to be serialized in json
  * and push in elasticsearch
  *
  * @return array
  */
 public static function buildObjectArray(DataField $data, array &$out)
 {
     if (!$data->getFieldType()->getDeleted()) {
         /**
          * by default it serialize the text value.
          * It can be overrided.
          */
         $out[$data->getFieldType()->getName()] = $data->getTextValue();
     }
 }