src/snac/server/identityReconciliation/ReconciliationEngine.php
/**
     * Collate Results
     *
     * This function takes the raw output of the reconciliation engine and
     * reformats it back to results that can be easily parsed by id.
     * Specifically, it takes the results of the per-test values and returns
     * them per-id.
     */
Collate Results
This function takes the raw output of the reconciliation engine and
reformats it back to results that can be easily parsed by id.
Specifically, it takes the results of the per-test values and returns
them per-id.
Collate Results This function takes the raw output of the reconciliation engine and reformats it back to results that can be easily parsed by id . Specifically it takes the results of the per - test values and returns them per - id .
public function collateResults() {
        $all = array();
        foreach ($this->rawResults as $test => $resList) {
            foreach ($resList as $res) {
                $k = null;
                if ($res->getIdentity() == null) {
                    $all[$test] = $res->getStrength();
                } else {
                    $k = $res->getIdentity()->getArkID();
                    if (!array_key_exists($k, $this->results)) {
                        $this->results[$k] = new \snac\data\ReconciliationResult();
                        $this->results[$k]->setIdentity($res->getIdentity());
                    }
                    $this->results[$k]->setScore($test, $res->getStrength());
                    $this->results[$k]->setMultipleProperties($res->getAllProperties());
                }
            }
        }
        foreach ($this->results as &$v) {
            foreach ($all as $test => $result)
                $v->setScore($test, $result);
        }
        unset($v);
    }
public function collateResults ( ) { $ all = array ( ) ; foreach ( $ this -> rawResults as $ test => $ resList ) { foreach ( $ resList as $ res ) { $ k = null ; if ( $ res -> getIdentity ( ) == null ) { $ all [ $ test ] = $ res -> getStrength ( ) ; } else { $ k = $ res -> getIdentity ( ) -> getArkID ( ) ; if ( ! array_key_exists ( $ k , $ this -> results ) ) { $ this -> results [ $ k ] = new \ snac \ data \ ReconciliationResult ( ) ; $ this -> results [ $ k ] -> setIdentity ( $ res -> getIdentity ( ) ) ; } $ this -> results [ $ k ] -> setScore ( $ test , $ res -> getStrength ( ) ) ; $ this -> results [ $ k ] -> setMultipleProperties ( $ res -> getAllProperties ( ) ) ; } } } foreach ( $ this -> results as & $ v ) { foreach ( $ all as $ test => $ result ) $ v -> setScore ( $ test , $ result ) ; } unset ( $ v ) ; }
Collate Results
 This function takes the raw output of the reconciliation engine and
 reformats it back to results that can be easily parsed by id.
Collate Results This function takes the raw output of the reconciliation engine and reformats it back to results that can be easily parsed by id .
// If the identity is null, this should apply to all results // Get Unique ID for this identity // Create entry in the array if it doesn't exist // Store the strength value in the vector // Add any global results to every id's vector // Be correct with foreach pass by reference