private function doAggregateFromFieldChangeOp($type, $fieldChangeOp, &$aggregate) { $searchTable = $this->searchTableUpdater->getSearchTable(); // Exempted property -> out if (!$fieldChangeOp->has('p_id') || $searchTable->isExemptedPropertyById($fieldChangeOp->get('p_id'))) { return; } // Only text components if (!$fieldChangeOp->has('o_blob') && !$fieldChangeOp->has('o_hash') && !$fieldChangeOp->has('o_serialized')) { return; } // Re-map (url type) if ($fieldChangeOp->has('o_serialized')) { $fieldChangeOp->set('o_blob', $fieldChangeOp->get('o_serialized')); } // Build a temporary stable key for the diff match $key = $fieldChangeOp->get('s_id') . ':' . $fieldChangeOp->get('p_id'); // If the blob value is empty then the DIHandler has put any text < 72 // into the hash field $text = $fieldChangeOp->get('o_blob'); if ($text === null || $text === '') { $text = $fieldChangeOp->get('o_hash'); } if (!isset($aggregate[$key])) { $aggregate[$key] = $type === TableChangeOp::OP_DELETE ? array() : ''; } // Concatenate the inserts but keep the deletes separate to allow // for them to be removed individually if ($type === TableChangeOp::OP_INSERT) { $aggregate[$key] = trim($aggregate[$key] . ' ' . trim($text)); } elseif ($type === TableChangeOp::OP_DELETE) { $aggregate[$key][] = $this->textSanitizer->sanitize($text); } }
/** * @since 2.5 * * @return SearchTable */ public function getSearchTable() { return $this->searchTableUpdater->getSearchTable(); }