src/snac/server/identityReconciliation/stages/EntityTypeFilter.php
/**
     * Run function
     *
     * Compares the entity type term strings (i.e. "person").  If they match, a score of 0 is assigned.  If not,
     * then the score is discounted by a constant.
     *
     * @param \snac\data\Constellation $search The constellation to be evaluated.
     * @param \snac\data\Constellation[] $list A list of constellation to evaluate against.  This
     * may be null.
     * @return array An array of results.  On error, it must at least
     * return an empty array. It may not return null.
     *
     */
Run function
Compares the entity type term strings .  If they match, a score of 0 is assigned.  If not,
then the score is discounted by a constant.

@param \snac\data\Constellation $search The constellation to be evaluated.
@param \snac\data\Constellation[] $list A list of constellation to evaluate against.  This
may be null.
@return array An array of results.  On error, it must at least
return an empty array. It may not return null.
Run function Compares the entity type term strings . If they match a score of 0 is assigned . If not then the score is discounted by a constant . @param \ snac \ data \ Constellation $search The constellation to be evaluated . @param \ snac \ data \ Constellation [] $list A list of constellation to evaluate against . This may be null . @return array An array of results . On error it must at least return an empty array . It may not return null .
public function run($search, $list) {
        if ($list == null)
            return array();
        $results = array();
        foreach ($list as $res) {
            $strength = 0;
            if ($search->getEntityType() !== null && $search->getEntityType()->getTerm() !== null) {
                if ($search->getEntityType()->getTerm() != $res->getIdentity()->getEntityType()->getTerm()) {
                    $strength = $this->discount;
                }
            }
            $result = new \snac\data\ReconciliationResult();
            $result->setIdentity($res->getIdentity());
            $result->setStrength($strength);
            array_push($results, $result);
        }
        return $results;
    }
public function run ( $ search , $ list ) { if ( $ list == null ) return array ( ) ; $ results = array ( ) ; foreach ( $ list as $ res ) { $ strength = 0 ; if ( $ search -> getEntityType ( ) !== null && $ search -> getEntityType ( ) -> getTerm ( ) !== null ) { if ( $ search -> getEntityType ( ) -> getTerm ( ) != $ res -> getIdentity ( ) -> getEntityType ( ) -> getTerm ( ) ) { $ strength = $ this -> discount ; } } $ result = new \ snac \ data \ ReconciliationResult ( ) ; $ result -> setIdentity ( $ res -> getIdentity ( ) ) ; $ result -> setStrength ( $ strength ) ; array_push ( $ results , $ result ) ; } return $ results ; }
Run function
 Compares the entity type term strings (i.e.
Run function Compares the entity type term strings ( i . e .
// Error case, list is null // Compute the strength value // Save the result